json: indent 4 spaces

This commit is contained in:
Olivier Chafik 2024-03-20 14:47:21 +00:00
parent 7628bd8c76
commit 10ee30f1b8
5 changed files with 868 additions and 869 deletions

View file

@ -4,9 +4,9 @@
#! python json-schema-pydantic-example.py
from pydantic import BaseModel, TypeAdapter
from annotated_types import MaxLen, MinLen
from typing import Annotated, Iterable, List, Optional
import enum, json, requests
from annotated_types import MinLen
from typing import Annotated, List, Optional
import json, requests
if True:

View file

@ -20,7 +20,8 @@ static std::string trim(const std::string & source) {
}
enum TestCaseStatus {
SUCCESS, FAILURE
SUCCESS,
FAILURE
};
struct TestCase {
@ -810,14 +811,12 @@ int main() {
}
});
test_all("Python", [](const TestCase& tc) {
write("test-json-schema-input.tmp", tc.schema);
tc.verify_status(std::system(
"python ./examples/json-schema-to-grammar.py test-json-schema-input.tmp > test-grammar-output.tmp") == 0 ? SUCCESS : FAILURE);
tc.verify(read("test-grammar-output.tmp"));
});
test_all("JavaScript", [](const TestCase& tc) {
write("test-json-schema-input.tmp", tc.schema);
tc.verify_status(std::system(
"node ./tests/run-json-schema-to-grammar.mjs test-json-schema-input.tmp > test-grammar-output.tmp") == 0 ? SUCCESS : FAILURE);