Compiler experimentation.
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add failing example program

+17 -8
-8
src/lib.rs
··· 2 2 pub fn compile_and_run(_input: &str) -> i32 { 3 3 0 4 4 } 5 - 6 - #[cfg(test)] 7 - mod test { 8 - #[test] 9 - fn foo() { 10 - assert_eq!(1, 2); 11 - } 12 - }
+2
tests/examples/t_001.zbr
··· 1 + main : I32 2 + main = 1
+15
tests/main.rs
··· 1 + macro_rules! expect { 2 + ($name:ident, $expected:expr) => { 3 + #[test] 4 + fn $name() { 5 + let res = zauber::compile_and_run(include_str!(concat!( 6 + "examples/", 7 + stringify!($name), 8 + ".zbr" 9 + ))); 10 + assert_eq!(res, $expected); 11 + } 12 + }; 13 + } 14 + 15 + expect!(t_001, 1);