You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
796 B
39 lines
796 B
|
|
#![allow(dead_code)]
|
|
|
|
mod ext; use ext::*;
|
|
|
|
// Internal modules
|
|
mod object;
|
|
mod formats;
|
|
|
|
// TODO: External modules/functions/types/whatever
|
|
|
|
// TODO: FFI module, export C interface
|
|
|
|
#[cfg(test)]
|
|
mod tests {
|
|
|
|
use serde::{Serialize, Deserialize};
|
|
use serde_json::Value as JsonValue;
|
|
use serde_lexpr::Value as LexprValue;
|
|
|
|
#[test]
|
|
fn from_json_to_lisp() {
|
|
let value_js: JsonValue = serde_json::json!({
|
|
"number": 200.10,
|
|
"boolean": true,
|
|
"null_value": null,
|
|
"map": {
|
|
"array": ["string", false, null, 100.0, []],
|
|
"empty": {}
|
|
}
|
|
});
|
|
|
|
eprintln!("Value (json): {}", value_js);
|
|
|
|
println!("JSON: {}", serde_json::to_string(&value_js).expect("ser json"));
|
|
println!("LISP: {}", serde_lexpr::to_string(&value_js).expect("ser lisp"));
|
|
}
|
|
}
|