Skip to content

Commit da3c2d3

Browse files
committed
test: add test coverage for passing a json-formatted pdl program
We already support this (since yaml can embed json), but it seems worthwhile having an explicit test for this. Signed-off-by: Nick Mitchell <[email protected]>
1 parent 230b0b3 commit da3c2d3

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tests/test_hello.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import json
2+
13
import pytest
24

35
from pdl.pdl import exec_str
@@ -49,6 +51,11 @@ def test_hello():
4951
assert text == "Hello, world!\nThis is your first prompt descriptor!\n"
5052

5153

54+
def test_hello_json():
55+
result = exec_str(json.dumps(hello))
56+
assert result == "Hello, world!\nThis is your first prompt descriptor!\n"
57+
58+
5259
def repeat(n):
5360
state = InterpreterState()
5461
data = Program.model_validate(repeat_data(n))

0 commit comments

Comments
 (0)