Initial commit

This commit is contained in:
Jeehoon Kang
2020-03-17 17:31:16 +09:00
commit b929dc334d
54 changed files with 4368 additions and 0 deletions

21
tests/ast_printer_test.rs Normal file
View File

@@ -0,0 +1,21 @@
use std::path::Path;
use kecc::*;
#[test]
fn ast_printer_test() {
let mut parse = Parse::default();
let dir_path = Path::new("examples/");
let dir = dir_path.read_dir().expect("read_dir call failed");
for entry in dir {
let test_file = ok_or!(entry, continue);
let test_unit = parse.translate(&test_file.path().as_path()).expect(
&format!(
"parse failed {:?}",
test_file.path().into_os_string().to_str().unwrap()
)
.to_owned(),
);
write_c_test(&test_unit);
}
}