Skip to content

Commit fc389cd

Browse files
committed
updated tests to force "number" type
1 parent 7f89297 commit fc389cd

File tree

1 file changed

+25
-5
lines changed

1 file changed

+25
-5
lines changed

tests/extras/format.json

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -752,7 +752,7 @@
752752
},
753753
{
754754
"description": "validation of int32",
755-
"schema": {"format": "int32"},
755+
"schema": {"type": "number", "format": "int32"},
756756
"tests": [
757757
{
758758
"description": "256 is ok",
@@ -783,12 +783,17 @@
783783
"description": "2**31 fails",
784784
"data": 2147483648,
785785
"valid": false
786+
},
787+
{
788+
"description": "non-numeric fails",
789+
"data": "x",
790+
"valid": false
786791
}
787792
]
788793
},
789794
{
790795
"description": "validation of int64",
791-
"schema": {"format": "int64"},
796+
"schema": {"type": "number", "format": "int64"},
792797
"tests": [
793798
{
794799
"description": "256 is ok",
@@ -799,28 +804,43 @@
799804
"description": "float fails",
800805
"data": 256.1,
801806
"valid": false
807+
},
808+
{
809+
"description": "non-numeric fails",
810+
"data": "x",
811+
"valid": false
802812
}
803813
]
804814
},
805815
{
806816
"description": "validation of float",
807-
"schema": {"format": "float"},
817+
"schema": {"type": "number", "format": "float"},
808818
"tests": [
809819
{
810820
"description": "256.1 is ok",
811821
"data": 256.1,
812822
"valid": true
823+
},
824+
{
825+
"description": "non-numeric fails",
826+
"data": "x",
827+
"valid": false
813828
}
814829
]
815830
},
816831
{
817832
"description": "validation of double",
818-
"schema": {"format": "double"},
833+
"schema": {"type": "number", "format": "double"},
819834
"tests": [
820835
{
821836
"description": "256.1 is ok",
822-
"data": "256.1",
837+
"data": 256.1,
823838
"valid": true
839+
},
840+
{
841+
"description": "non-numeric fails",
842+
"data": "x",
843+
"valid": false
824844
}
825845
]
826846
},

0 commit comments

Comments
 (0)