validator refactor progress
This commit is contained in:
28
tests/lib.rs
28
tests/lib.rs
@ -1,4 +1,4 @@
|
||||
use jspg::*;
|
||||
use ::jspg::*;
|
||||
use pgrx::JsonB;
|
||||
use serde_json::json;
|
||||
|
||||
@ -22,20 +22,22 @@ fn test_library_api() {
|
||||
);
|
||||
|
||||
// 2. Cache schemas
|
||||
let puncs = json!([]);
|
||||
let types = json!([{
|
||||
"schemas": [{
|
||||
"$id": "test_schema",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": { "type": "string" }
|
||||
},
|
||||
"required": ["name"]
|
||||
let db_json = json!({
|
||||
"puncs": [],
|
||||
"enums": [],
|
||||
"types": [{
|
||||
"schemas": [{
|
||||
"$id": "test_schema",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"name": { "type": "string" }
|
||||
},
|
||||
"required": ["name"]
|
||||
}]
|
||||
}]
|
||||
}]);
|
||||
let enums = json!([]);
|
||||
});
|
||||
|
||||
let cache_drop = cache_json_schemas(JsonB(enums), JsonB(types), JsonB(puncs));
|
||||
let cache_drop = jspg_cache_database(JsonB(db_json));
|
||||
assert_eq!(
|
||||
cache_drop.0,
|
||||
json!({
|
||||
|
||||
Reference in New Issue
Block a user