oak-json 0.0.11

High-performance incremental JSON parser for the oak ecosystem with flexible configuration, optimized for data interchange and configuration files.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use oak_json::{JsonLanguage, JsonLexer};
use oak_testing::lexing::LexerTester;
use std::{path::Path, time::Duration};

#[test]
#[cfg(feature = "serde")]
fn test_json_lexer() -> Result<(), oak_core::OakError> {
    let here = Path::new(env!("CARGO_MANIFEST_DIR"));
    let language = JsonLanguage::default();
    let lexer = JsonLexer::new(&language);
    let test_runner = LexerTester::new(here.join("tests/lexer")).with_extension("json5").with_timeout(Duration::from_secs(5));
    test_runner.run_tests(&lexer)
}