Skip to content

Commit

Permalink
#236: Added test for another Token that needs to be included: While.
Browse files Browse the repository at this point in the history
  • Loading branch information
jvdb committed Jul 3, 2018
1 parent e725c68 commit e6b2f37
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@
import static io.parsingdata.metal.Shorthand.con;
import static io.parsingdata.metal.Shorthand.def;
import static io.parsingdata.metal.Shorthand.eq;
import static io.parsingdata.metal.Shorthand.ltNum;
import static io.parsingdata.metal.Shorthand.rep;
import static io.parsingdata.metal.Shorthand.repn;
import static io.parsingdata.metal.Shorthand.seq;
import static io.parsingdata.metal.Shorthand.whl;
import static io.parsingdata.metal.util.EncodingFactory.enc;
import static io.parsingdata.metal.util.ParseStateFactory.stream;

Expand All @@ -43,6 +45,7 @@ public static Collection<Object[]> data() {
return Arrays.asList(new Object[][] {
{ "[0, 1, 2, 3] rep(CURRENT_INDEX)", rep(VALUE_EQ_INDEX), stream(0, 1, 2, 3), enc(), true },
{ "[0, 1, 2, 3] repn(4, CURRENT_INDEX)", repn(VALUE_EQ_INDEX, con(4)), stream(0, 1, 2, 3), enc(), true },
{ "[0, 0, 1, 2, 3] def(0), while(<3, CURRENT_INDEX)", seq(def("value", con(1)), whl(VALUE_EQ_INDEX, ltNum(con(3)))), stream(0, 0, 1, 2, 3), enc(), true },
{ "[0, 1, 2, 3] seq(CURRENT_INDEX, ...)", seq(VALUE_EQ_INDEX, VALUE_EQ_INDEX, VALUE_EQ_INDEX, VALUE_EQ_INDEX), stream(0, 1, 2, 3), enc(), true }
});
}
Expand Down

0 comments on commit e6b2f37

Please sign in to comment.