Skip to content

Commit

Permalink
test: WIP extend right nullable test
Browse files Browse the repository at this point in the history
  • Loading branch information
igordejanovic committed Oct 13, 2023
1 parent fb8085f commit b45ce82
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion tests/src/glr/special/right_nullable/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use rustemo::{lr::builder::TreeBuilder, rustemo_mod, glr::gss::GssHead};
use rustemo::parser::Parser;
use rustemo::rustemo_mod;
use rustemo_compiler::output_cmp;

rustemo_mod!(lang, "/src/glr/special/right_nullable");
Expand All @@ -10,4 +10,22 @@ use self::lang::LangParser;
fn glr_special_right_nullable_g2() {
let forest = LangParser::new().parse("aa").unwrap();
assert_eq!(forest.solutions(), 1);
(1..=forest.solutions()).for_each(|i| {
let tree = forest.get_tree(i - 1);
let mut builder = TreeBuilder::new();
output_cmp!(
&format!("src/glr/special/right_nullable/tree_{}.ast", i),
format!("{:#?}", tree.unwrap().build::<TreeBuilder<
'_,
str,
lang::ProdKind,
lang::TokenKind,
>, GssHead<
'_,
str,
lang::State,
lang::TokenKind,
>, lang::State>(&mut builder))
);
})
}

0 comments on commit b45ce82

Please sign in to comment.