-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_parser_tests.sh
More file actions
48 lines (42 loc) · 906 Bytes
/
run_parser_tests.sh
File metadata and controls
48 lines (42 loc) · 906 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/bash
set -euo pipefail
cd /home/nick/code/agent-test
echo "Testing YAML parser..."
bash lib/parser/parse_yaml.sh tests/basic.yaml
echo ""
echo "Testing JSON parser..."
bash lib/parser/parse_json.sh tests/basic.json
echo ""
echo "Testing old format JSON (backward compatibility)..."
OLD_FORMAT_JSON=$(mktemp)
cat > "$OLD_FORMAT_JSON" << 'EOF'
{
"test_suite": {
"agent": "test",
"name": "Old Format Test",
"version": "1.0.0"
},
"test_cases": [
{
"id": "test-old-format",
"name": "Old format test",
"input": {
"prompt": "hello"
},
"expected_outputs": {
"response": "hello world!"
},
"assertions": [
{
"type": "response",
"value": "hello world!"
}
]
}
]
}
EOF
bash lib/parser/parse_json.sh "$OLD_FORMAT_JSON"
rm -f "$OLD_FORMAT_JSON"
echo ""
echo "All tests completed!"