From 73566899bf3bde655a9437af601fe5744f700a66 Mon Sep 17 00:00:00 2001 From: "Yubing (Tom) Dong" Date: Tue, 6 Oct 2015 00:51:25 -0700 Subject: [PATCH] Add Doc slicing tests --- tests/tokens/test_tokens_api.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/tokens/test_tokens_api.py b/tests/tokens/test_tokens_api.py index e1238373f..a7311932f 100644 --- a/tests/tokens/test_tokens_api.py +++ b/tests/tokens/test_tokens_api.py @@ -12,6 +12,15 @@ def test_getitem(EN): with pytest.raises(IndexError): tokens[len(tokens)] + span = tokens[1:1] + assert not '/'.join(token.orth_ for token in span) + span = tokens[1:4] + assert '/'.join(token.orth_ for token in span) == 'it/back/!' + with pytest.raises(ValueError): + tokens[1:4:2] + with pytest.raises(ValueError): + tokens[1:4:-1] + @pytest.mark.models def test_serialize(EN):