From 64f747cb65f4769b18beb9abedd1f7eae3707f84 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Mon, 9 Jan 2017 19:12:00 +0100 Subject: [PATCH] Token comparison test --- spacy/tests/tokens/test_tokens_api.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/spacy/tests/tokens/test_tokens_api.py b/spacy/tests/tokens/test_tokens_api.py index c94ee5de2..c9b57e689 100644 --- a/spacy/tests/tokens/test_tokens_api.py +++ b/spacy/tests/tokens/test_tokens_api.py @@ -12,6 +12,10 @@ import pytest def test_tokens_compare_by_string_position(): vocab = Vocab() doc = Doc(vocab, [u'one', u'two', u'three']) + # Get the tokens in this order, so their ID ordering doesn't match the idx + three = doc[-1] + two = doc[-2] + one = doc[-1] one, two, three = doc assert one < two < three assert not one > two