Add tests for token comparison, re Issue
@@ -4,9 +4,21 @@ from spacy.tokens import Doc
from spacy.en import English
import numpy
from spacy.attrs import HEAD
+from ...vocab import Vocab
+from ...tokens.doc import Doc
import pytest
+def test_tokens_compare_by_string_position():
+ vocab = Vocab()
+ doc = Doc(vocab, [u'one', u'two', u'three'])
+ one, two, three = doc
+ assert one < two < three
+ assert not one > two
+ assert two > one
+ assert two <= three
+ assert three >= one
+
@pytest.mark.models
def test_getitem(EN):
