Skip to content

Commit

Permalink
Test cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Arpita-Jaiswal committed Oct 29, 2024
1 parent 3b9d7f2 commit b258ae1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 13 deletions.
4 changes: 1 addition & 3 deletions v0.5/fastn-p1/src/debug.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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! ({
Expand Down
16 changes: 8 additions & 8 deletions v0.5/fastn-p1/src/parser/kind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,19 +64,19 @@ mod test {
#[test]
fn kind() {
t!("string", "string");
t!("list<string>", {"name": {"module": "list"}, "args": ["string"]});
t!("foo<a, b>", {"name": {"module": "foo"}, "args": ["a", "b"]});
t!("list<string>", {"name": "list", "args": ["string"]});
t!("foo<a, b>", {"name": "foo", "args": ["a", "b"]});
t!(
"foo<bar<k>>",
{"name": {"module": "foo"}, "args": [{"name": {"module": "bar"}, "args": ["k"]}]}
{"name": "foo", "args": [{"name": "bar", "args": ["k"]}]}
);
t!(
"foo<a, b<asd>, c, d>",
{
"name": {"module": "foo"},
"name": "foo",
"args": [
"a",
{"name": {"module": "b"}, "args": ["asd"]},
{"name": "b", "args": ["asd"]},
"c",
"d"
]
Expand All @@ -85,19 +85,19 @@ mod test {
t!(
"foo<a, b, c, d, e>",
{
"name": {"module": "foo"},
"name": "foo",
"args": ["a","b","c","d","e"]
}
);

t!(
"foo<bar<k>> ",
{"name": {"module": "foo"}, "args": [{"name": {"module": "bar"}, "args": ["k"]}]},
{"name": "foo", "args": [{"name": "bar", "args": ["k"]}]},
" "
);
t!(
"foo<bar<k>> moo",
{"name": {"module": "foo"}, "args": [{"name": {"module": "bar"}, "args": ["k"]}]},
{"name": "foo", "args": [{"name": "bar", "args": ["k"]}]},
" moo"
);
}
Expand Down
3 changes: 1 addition & 2 deletions v0.5/fastn-p1/src/parser/qualified_identifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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!(
Expand Down

0 comments on commit b258ae1

Please sign in to comment.