tree-sitter/spec/compiler/rules/repeat_spec.cc

23 lines
520 B
C++
Raw Normal View History

#include "spec_helper.h"
#include "compiler/rules/repeat.h"
#include "compiler/rules/symbol.h"
using namespace rules;
START_TEST
describe("Repeat", []() {
describe("constructing repeats", [&]() {
it("doesn't create redundant repeats", [&]() {
2016-11-30 09:34:47 -08:00
auto sym = make_shared<Symbol>(1, Symbol::NonTerminal);
auto repeat = Repeat::build(sym);
auto outer_repeat = Repeat::build(repeat);
AssertThat(repeat, !Equals(sym));
AssertThat(outer_repeat, Equals(repeat));
});
});
});
END_TEST