Skip to content

Commit

Permalink
More TreebankRetriever specs
Browse files Browse the repository at this point in the history
  • Loading branch information
LFDM committed Nov 17, 2014
1 parent c3c824c commit 539e42d
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions spec/arethusa/treebank_retriever_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,20 @@ describe('TreebankRetriever', function() {
expect(tokenIds.length).toEqual(2); // 2 tokens
expect(s1.tokens[tokenIds[0]].string).toEqual('a');
});

it('does not fail when a treebank consists of a single sentence', function() {
var tb = toTreebank([[1, [[1, 'a'], [2, 'b']]]]);
retriever.parse(tb, callback);
expect(result.length).toEqual(1); // 1 sentence
});

// Tests the bug described in http://github.com/latin-language-toolkit/arethusa/issues/440
it('does not fail when a sentence consists of a single word', function() {
var tb = toTreebank([[1, [[1, 'a']]]]);
retriever.parse(tb, callback);

var tokenIds = Object.keys(result[0].tokens);
expect(tokenIds.length).toEqual(1); // 1 token
});
});
});

0 comments on commit 539e42d

Please sign in to comment.