diff options
Diffstat (limited to 'test/trans.d/case/any1_rust.rl')
-rw-r--r-- | test/trans.d/case/any1_rust.rl | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/test/trans.d/case/any1_rust.rl b/test/trans.d/case/any1_rust.rl new file mode 100644 index 00000000..fc7939e2 --- /dev/null +++ b/test/trans.d/case/any1_rust.rl @@ -0,0 +1,44 @@ +// +// @LANG: rust +// @GENERATED: true +// + + + + +%%{ + machine any1; + main := any; +}%% + + + +%% write data; + +unsafe fn m( s: String ) +{ + let data: &[u8] = s.as_bytes(); + let mut p:i32 = 0; + let mut pe:i32 = s.len() as i32; + let mut eof:i32 = s.len() as i32; + let mut cs: i32 = 0; + let mut buffer = String::new(); + + %% write init; + %% write exec; + + if ( cs >= any1_first_final ) { + println!( "ACCEPT" ); + } + else { + println!( "FAIL" ); + } +} + +fn main() +{ + unsafe { m( "".to_string() ); } + unsafe { m( "x".to_string() ); } + unsafe { m( "xx".to_string() ); } +} + |