add unicode_xid, test

This commit is contained in:
ekicyou
2020-07-29 08:25:37 +09:00
parent 9b0375b870
commit 288e0a4d14
3 changed files with 30 additions and 3 deletions

View File

@@ -51,3 +51,21 @@ fn test_tokens_custom_operator() -> Result<(), Box<EvalAltResult>> {
Ok(())
}
#[test]
fn test_tokens_unicode_xid_ident() -> Result<(), Box<EvalAltResult>> {
let engine = Engine::new();
let result = engine.eval::<INT>(
r"
fn すべての答え() { 42 }
すべての答え()
",
);
#[cfg(feature = "unicode-xid-ident")]
assert_eq!(result?, 42);
#[cfg(not(feature = "unicode-xid-ident"))]
assert!(result.is_err());
Ok(())
}