MCPcopy Create free account
hub / github.com/dprint/jsonc-parser / test_specs

Function test_specs

tests/test.rs:13–31  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

11
12#[test]
13fn test_specs() {
14 for json_path in get_json_file_paths_in_dir(Path::new("./tests/specs")) {
15 let text_file_path = json_path.with_extension("txt");
16 let json_file_text = fs::read_to_string(&json_path).unwrap().replace("\r\n", "\n");
17 let result = parse_to_ast(
18 &json_file_text,
19 &CollectOptions {
20 comments: CommentCollectionStrategy::Separate,
21 tokens: true,
22 },
23 &Default::default(),
24 )
25 .expect("Expected no error.");
26 let result_text = parse_result_to_test_str(&result);
27 let expected_text = fs::read_to_string(&text_file_path).unwrap().replace("\r\n", "\n");
28 // fs::write(&text_file_path, result_text.clone()).unwrap();
29 assert_eq!(result_text.trim(), expected_text.trim());
30 }
31}
32
33#[cfg(feature = "cst")]
34#[test]

Callers

nothing calls this directly

Calls 3

parse_to_astFunction · 0.85
parse_result_to_test_strFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…