2013-11-12 18:37:02 -08:00
|
|
|
#include "spec_helper.h"
|
|
|
|
|
|
|
|
|
|
using namespace tree_sitter::lr;
|
|
|
|
|
|
2013-12-28 15:09:52 -08:00
|
|
|
START_TEST
|
|
|
|
|
|
|
|
|
|
describe("items", []() {
|
|
|
|
|
Grammar grammar = test_grammars::arithmetic();
|
|
|
|
|
|
|
|
|
|
describe("transitions", [&]() {
|
|
|
|
|
it("finds the item at the start of a rule", [&]() {
|
2013-11-12 18:37:02 -08:00
|
|
|
Item item = Item::at_beginning_of_rule("expression", grammar);
|
2013-11-13 20:22:06 -08:00
|
|
|
AssertThat(item, Equals(Item("expression", grammar.rule("expression"), 0)));
|
2013-12-28 15:09:52 -08:00
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
END_TEST
|