From b258ae19f5cc8bc313b989ec4e9015508b336060 Mon Sep 17 00:00:00 2001 From: Arpita-Jaiswal Date: Wed, 30 Oct 2024 00:58:41 +0530 Subject: [PATCH] Test cleanup --- v0.5/fastn-p1/src/debug.rs | 4 +--- v0.5/fastn-p1/src/parser/kind.rs | 16 ++++++++-------- v0.5/fastn-p1/src/parser/qualified_identifier.rs | 3 +-- 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/v0.5/fastn-p1/src/debug.rs b/v0.5/fastn-p1/src/debug.rs index 7edc8d517..e070726ac 100644 --- a/v0.5/fastn-p1/src/debug.rs +++ b/v0.5/fastn-p1/src/debug.rs @@ -112,9 +112,7 @@ impl JDebug for fastn_p1::Kind { impl JDebug for fastn_p1::QualifiedIdentifier { fn debug(&self, source: &str) -> serde_json::Value { if self.terms.is_empty() { - return serde_json::json! ({ - "module": self.module.debug(source), - }); + return self.module.debug(source); } serde_json::json! ({ diff --git a/v0.5/fastn-p1/src/parser/kind.rs b/v0.5/fastn-p1/src/parser/kind.rs index bf2e150fb..90c948e09 100644 --- a/v0.5/fastn-p1/src/parser/kind.rs +++ b/v0.5/fastn-p1/src/parser/kind.rs @@ -64,19 +64,19 @@ mod test { #[test] fn kind() { t!("string", "string"); - t!("list", {"name": {"module": "list"}, "args": ["string"]}); - t!("foo", {"name": {"module": "foo"}, "args": ["a", "b"]}); + t!("list", {"name": "list", "args": ["string"]}); + t!("foo", {"name": "foo", "args": ["a", "b"]}); t!( "foo>", - {"name": {"module": "foo"}, "args": [{"name": {"module": "bar"}, "args": ["k"]}]} + {"name": "foo", "args": [{"name": "bar", "args": ["k"]}]} ); t!( "foo, c, d>", { - "name": {"module": "foo"}, + "name": "foo", "args": [ "a", - {"name": {"module": "b"}, "args": ["asd"]}, + {"name": "b", "args": ["asd"]}, "c", "d" ] @@ -85,19 +85,19 @@ mod test { t!( "foo", { - "name": {"module": "foo"}, + "name": "foo", "args": ["a","b","c","d","e"] } ); t!( "foo> ", - {"name": {"module": "foo"}, "args": [{"name": {"module": "bar"}, "args": ["k"]}]}, + {"name": "foo", "args": [{"name": "bar", "args": ["k"]}]}, " " ); t!( "foo> moo", - {"name": {"module": "foo"}, "args": [{"name": {"module": "bar"}, "args": ["k"]}]}, + {"name": "foo", "args": [{"name": "bar", "args": ["k"]}]}, " moo" ); } diff --git a/v0.5/fastn-p1/src/parser/qualified_identifier.rs b/v0.5/fastn-p1/src/parser/qualified_identifier.rs index 1029588cd..844c8e292 100644 --- a/v0.5/fastn-p1/src/parser/qualified_identifier.rs +++ b/v0.5/fastn-p1/src/parser/qualified_identifier.rs @@ -37,8 +37,7 @@ mod test { #[test] fn qualified_identifier() { - t!("foo", {"module": "foo"}); - // t!("foo", {"module": "foo"}); + t!("foo", "foo"); t!("foo.com#bar", { "module": "foo.com", "terms": ["bar"]}); t!("foo.com#bar.baz", { "module": "foo.com", "terms": ["bar", "baz"]}); t!(