tree-sitter/spec/compiler/rules/repeat_spec.cc
2015-01-14 21:11:19 -08:00

22 lines
517 B
C++

#include "compiler/compiler_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", [&]() {
auto sym = make_shared<Symbol>(1);
auto repeat = Repeat::build(sym);
auto outer_repeat = Repeat::build(repeat);
AssertThat(repeat, !Equals(sym));
AssertThat(outer_repeat, Equals(repeat));
});
});
});
END_TEST