AT_KEYWORDS([json positive])
AT_CHECK([printf %s "AS_ESCAPE([$2])" > input])
AT_CAPTURE_FILE([input])
- OVS_CHECK_LCOV([test-json $4 input], [0], [stdout], [])
+ AT_CHECK([test-json $4 input], [0], [stdout], [])
AT_CHECK([cat stdout], [0], [$3
])
AT_CLEANUP])
AT_KEYWORDS([json negative])
AT_CHECK([printf %s "AS_ESCAPE([$2])" > input])
AT_CAPTURE_FILE([input])
- OVS_CHECK_LCOV([test-json $4 input], [1], [stdout], [])
+ AT_CHECK([test-json $4 input], [1], [stdout], [])
AT_CHECK([[sed 's/^error: [^:]*:/error:/' < stdout]], [0], [$3
])
AT_CLEANUP])
JSON_CHECK_NEGATIVE([bad escape in quoted string],
[[["\x12"]]],
[error: bad escape \x])
-JSON_CHECK_NEGATIVE([\u must be followed by 4 hex digits],
+JSON_CHECK_NEGATIVE([\u must be followed by 4 hex digits (1)],
[[["\u1x"]]],
+ [error: quoted string ends within \u escape])
+JSON_CHECK_NEGATIVE([\u must be followed by 4 hex digits (2)],
+ [[["\u1xyz"]]],
[error: malformed \u escape])
JSON_CHECK_NEGATIVE([isolated leading surrogate not allowed],
[[["\ud834xxx"]]],
AT_SETUP([end of input in quoted string])
AT_KEYWORDS([json negative])
-AT_CHECK([printf '\"xxx' | test-json -], [1],
+AT_CHECK([printf '"xxx' | test-json -], [1],
[error: line 0, column 4, byte 4: unexpected end of input in quoted string
])
AT_CLEANUP
[scientific notation],
[[[1e3, 1E3, 2.5E2, 1e+3, 125e-3, 3.125e-2, 3125e-05, 1.525878906e-5]]],
[[[1000,1000,250,1000,0.125,0.03125,0.03125,1.525878906e-05]]])
+# It seems likely that the following test will fail on some system that
+# rounds slightly differently in arithmetic or in printf, but I'd like
+# to keep it this way until we run into such a system.
+JSON_CHECK_POSITIVE(
+ [+/- DBL_MAX],
+ [[[1.7976931348623157e+308, -1.7976931348623157e+308]]],
+ [[[1.79769313486232e+308,-1.79769313486232e+308]]])
+
JSON_CHECK_POSITIVE(
[negative reals],
[[[-0, -1.0, -2.0, -3.0, -3.5, -8.1250]]],