grammar : use int64_t to avoid int overflows in int schema to grammar conversion logic (#16626)
This commit is contained in:
parent
ceff6bb253
commit
79967ec596
2 changed files with 36 additions and 12 deletions
|
|
@ -301,6 +301,30 @@ static void test_simple_grammar() {
|
|||
"0123",
|
||||
}
|
||||
);
|
||||
test_schema(
|
||||
"min 1 max 900719925474091",
|
||||
// Schema
|
||||
R"""({
|
||||
"type": "integer",
|
||||
"exclusiveMinimum": 0,
|
||||
"maximum": 900719925474091
|
||||
})""",
|
||||
// Passing strings
|
||||
{
|
||||
"1",
|
||||
"2",
|
||||
"10",
|
||||
"900719925474090",
|
||||
"900719925474091",
|
||||
},
|
||||
// Failing strings
|
||||
{
|
||||
"0",
|
||||
"01",
|
||||
"900719925474092",
|
||||
"9007199254740910",
|
||||
}
|
||||
);
|
||||
test_schema(
|
||||
"min -1 max 1",
|
||||
R"""({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue