Skip to content

Commit

Permalink
Write system tests for lobster-json regarding directory input
Browse files Browse the repository at this point in the history
- Add a requirement to specify the behavior when a directory is specified as input
- Add system tests
  • Loading branch information
phiwuu committed Feb 11, 2025
1 parent bb92390 commit 3a02d99
Show file tree
Hide file tree
Showing 19 changed files with 154 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"data": [
{
"tag": "json ./file.json:tree on island",
"location": {
"kind": "file",
"file": "./file.json",
"line": null,
"column": null
},
"name": "./file.json:tree on island",
"messages": [],
"just_up": [],
"just_down": [],
"just_global": [],
"framework": "JSON",
"kind": "Test Vector",
"status": null
}
],
"generator": "lobster-json",
"schema": "lobster-act-trace",
"version": 3
}
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lobster-json: wrote 1 items to output.lobster
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
--single
--tag-attribute=something
--name-attribute=name
--out=output.lobster
dir1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"data": [
{
"tag": "json ./dir1/dir2/deeply-nested.json:dir1.dir2.deeply-nested.1",
"location": {
"kind": "file",
"file": "./dir1/dir2/deeply-nested.json",
"line": null,
"column": null
},
"name": "./dir1/dir2/deeply-nested.json:dir1.dir2.deeply-nested.1",
"messages": [],
"just_up": [],
"just_down": [],
"just_global": [],
"framework": "JSON",
"kind": "Test Vector",
"status": null
},
{
"tag": "json ./dir1/nested.json:dir1.nested.1",
"location": {
"kind": "file",
"file": "./dir1/nested.json",
"line": null,
"column": null
},
"name": "./dir1/nested.json:dir1.nested.1",
"messages": [],
"just_up": [],
"just_down": [],
"just_global": [],
"framework": "JSON",
"kind": "Test Vector",
"status": null
},
{
"tag": "json ./file.json:file.1",
"location": {
"kind": "file",
"file": "./file.json",
"line": null,
"column": null
},
"name": "./file.json:file.1",
"messages": [],
"just_up": [],
"just_down": [],
"just_global": [],
"framework": "JSON",
"kind": "Test Vector",
"status": null
}
],
"generator": "lobster-json",
"schema": "lobster-act-trace",
"version": 3
}
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lobster-json: wrote 3 items to output.lobster
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
--single
--tag-attribute=something
--out=output.lobster
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"cherry": {
"data": [
{
"name": "element three"
}
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"banana": {
"data": [
{
"name": "element two"
}
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"apple": {
"data": [
{
"name": "element one"
}
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
The input file of this test defines a JSON data struct which has got data items in its
outer-most dictionary, as well as nested items.
According to the requirement only the data items from the outer-most dictionary must be considered.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lobster-json: wrote 1 items to output.lobster
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
--single
--tag-attribute=something
--out=output.lobster
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"outer1": {
"data": [
{
"name": "Take this item!"
},
{

"name": "unclear"
}
]
},
"outer2": {
"data": [
{
"name": "Take this item!"
},
{

"name": "unclear"
}
]
}
}

0 comments on commit 3a02d99

Please sign in to comment.