extern crate go_parser as fe;
use std::fs;
fn load_parse(path: &str, trace: bool) -> usize {
let mut fs = fe::FileSet::new();
let src = fs::read_to_string(path).expect("read file err: ");
let o = &mut fe::AstObjects::new();
let el = &mut fe::ErrorList::new();
let (p, _) = fe::parse_file(o, &mut fs, el, path, &src, trace);
print!("{}", p.get_errors());
let l = p.get_errors().len();
l
}
#[test]
fn test_parser_case0() {
load_parse("./../../go/src/archive/tar/strconv_test.go", true);
}
#[test]
fn test_parser_case1() {
let err_cnt = load_parse("./tests/data/case1.gos", true);
dbg!(err_cnt);
}
#[test]
fn test_issue3() {
let mut fs = fe::FileSet::new();
let o = &mut fe::AstObjects::new();
let el = &mut fe::ErrorList::new();
let (p, _) = fe::parse_file(o, &mut fs, el, "/a", "`", false);
print!("{}", p.get_errors());
}