Skip to content

Commit 954cc31

Browse files
akbakb
authored andcommitted
Add jsonl test
1 parent 0d4bfdf commit 954cc31

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

src/mario_addons/plugins/addons.toml

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -91,14 +91,19 @@ Anything in here
9191

9292
[[alias]]
9393

94-
name = "jsonl"
95-
help = "Load jsonlines into python objects"
94+
name = "jsonl"
95+
help = "Load jsonlines into python objects"
9696

97-
[[alias.stage]]
97+
[[alias.stage]]
98+
99+
command = "map"
98100

99-
command = "map"
101+
options = {code="json.loads"}
100102

101-
options = {code="json.loads"}
103+
[[alias.test_spec]]
104+
invocation = ["jsonl"]
105+
input = """{"name": "Alice", "age": "21"}\n{"name": "Bob", "age": "22"}\n"""
106+
output = """{'name': 'Alice', 'age': '21'}\n{'name': 'Bob', 'age': '22'}\n"""
102107

103108

104109
[[alias]]
@@ -129,12 +134,5 @@ options = {code="json.loads"}
129134

130135
[[alias.test_spec]]
131136
invocation = ["csv"]
132-
input = """
133-
name,age
134-
Alice,21
135-
Bob,22
136-
"""
137-
output = """
138-
{'name': 'Alice', 'age': '21'}
139-
{'name': 'Bob', 'age': '22'}
140-
"""
137+
input = """name,age\nAlice,21\nBob,22\n"""
138+
output = """{'name': 'Alice', 'age': '21'}\n{'name': 'Bob', 'age': '22'}\n"""

0 commit comments

Comments
 (0)