|
|
@@ -11,22 +11,19 @@ feature -- Test
|
|
|
|
test_json_number_and_integer
|
|
|
|
test_json_number_and_integer
|
|
|
|
local
|
|
|
|
local
|
|
|
|
i: INTEGER
|
|
|
|
i: INTEGER
|
|
|
|
i8: INTEGER_8
|
|
|
|
jn: JSON_NUMBER
|
|
|
|
jn: detachable JSON_NUMBER
|
|
|
|
|
|
|
|
jrep: STRING
|
|
|
|
jrep: STRING
|
|
|
|
parser: JSON_PARSER
|
|
|
|
parser: JSON_PARSER
|
|
|
|
do
|
|
|
|
do
|
|
|
|
i := 42
|
|
|
|
i := 42
|
|
|
|
-- Eiffel value -> JSON value -> JSON representation
|
|
|
|
-- Eiffel value -> JSON value -> JSON representation
|
|
|
|
create jn.make_integer (i)
|
|
|
|
create jn.make_integer (i)
|
|
|
|
assert ("jn /= Void", jn /= Void)
|
|
|
|
assert ("jn.representation.same_string (%"42%")", jn.representation.same_string ("42"))
|
|
|
|
assert ("jn.representation.is_equal (%"42%")", jn.representation.is_equal ("42"))
|
|
|
|
|
|
|
|
-- Eiffel value -> JSON value -> JSON representation with factory
|
|
|
|
-- Eiffel value -> JSON value -> JSON representation with factory
|
|
|
|
jn := Void
|
|
|
|
if attached {JSON_NUMBER} json.value (i) as l_jn then
|
|
|
|
jn ?= json.value (i)
|
|
|
|
assert ("l_jn.representation.same_string (%"42%")", jn.representation.same_string ("42"))
|
|
|
|
assert ("jn /= Void", jn /= Void)
|
|
|
|
else
|
|
|
|
if attached jn as l_jn then
|
|
|
|
assert ("json.value (i) is a JSON_NUMBER", False)
|
|
|
|
assert ("jn.representation.is_equal (%"42%")", jn.representation.is_equal ("42"))
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
-- JSON representation-> JSON value -> Eiffel value
|
|
|
|
-- JSON representation-> JSON value -> Eiffel value
|
|
|
@@ -35,32 +32,33 @@ feature -- Test
|
|
|
|
-- we know it is INTEGER_8 since the value is 42
|
|
|
|
-- we know it is INTEGER_8 since the value is 42
|
|
|
|
jrep := "42"
|
|
|
|
jrep := "42"
|
|
|
|
create parser.make_parser (jrep)
|
|
|
|
create parser.make_parser (jrep)
|
|
|
|
jn := Void
|
|
|
|
if attached {JSON_NUMBER} parser.parse as l_jn then
|
|
|
|
jn ?= parser.parse
|
|
|
|
if attached {INTEGER_8} json.object (jn, Void) as l_i8 then
|
|
|
|
assert ("jn /= Void", jn /= Void)
|
|
|
|
assert ("l_i8 = 42", l_i8 = 42)
|
|
|
|
i8 := 0
|
|
|
|
else
|
|
|
|
i8 ?= json.object (jn, Void)
|
|
|
|
assert ("json.object (jn, Void) is a INTEGER_8", False)
|
|
|
|
assert ("i8 = 42", i8 = 42)
|
|
|
|
end
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
assert ("parser.parse is a JSON_NUMBER", False)
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
test_json_number_and_integer_8
|
|
|
|
test_json_number_and_integer_8
|
|
|
|
local
|
|
|
|
local
|
|
|
|
i8: INTEGER_8
|
|
|
|
i8: INTEGER_8
|
|
|
|
jn: detachable JSON_NUMBER
|
|
|
|
jn: JSON_NUMBER
|
|
|
|
jrep: STRING
|
|
|
|
jrep: STRING
|
|
|
|
parser: JSON_PARSER
|
|
|
|
parser: JSON_PARSER
|
|
|
|
do
|
|
|
|
do
|
|
|
|
i8 := 42
|
|
|
|
i8 := 42
|
|
|
|
-- Eiffel value -> JSON value -> JSON representation
|
|
|
|
-- Eiffel value -> JSON value -> JSON representation
|
|
|
|
create jn.make_integer (i8)
|
|
|
|
create jn.make_integer (i8)
|
|
|
|
assert ("jn /= Void", jn /= Void)
|
|
|
|
assert ("jn.representation.same_string (%"42%")", jn.representation.same_string ("42"))
|
|
|
|
assert ("jn.representation.is_equal (%"42%")", jn.representation.is_equal ("42"))
|
|
|
|
|
|
|
|
-- Eiffel value -> JSON value -> JSON representation with factory
|
|
|
|
-- Eiffel value -> JSON value -> JSON representation with factory
|
|
|
|
jn := Void
|
|
|
|
if attached {JSON_NUMBER} json.value (i8) as l_jn then
|
|
|
|
jn ?= json.value (i8)
|
|
|
|
assert ("l_jn.representation.same_string (%"42%")", jn.representation.same_string ("42"))
|
|
|
|
assert ("jn /= Void", jn /= Void)
|
|
|
|
else
|
|
|
|
if attached jn as l_jn then
|
|
|
|
assert ("json.value (i8) is a JSON_NUMBER", False)
|
|
|
|
assert ("jn.representation.is_equal (%"42%")", jn.representation.is_equal ("42"))
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
-- JSON representation -> JSON value -> Eiffel value
|
|
|
|
-- JSON representation -> JSON value -> Eiffel value
|
|
|
@@ -69,32 +67,33 @@ feature -- Test
|
|
|
|
-- we know it is INTEGER_8 since the value is 42
|
|
|
|
-- we know it is INTEGER_8 since the value is 42
|
|
|
|
jrep := "42"
|
|
|
|
jrep := "42"
|
|
|
|
create parser.make_parser (jrep)
|
|
|
|
create parser.make_parser (jrep)
|
|
|
|
jn := Void
|
|
|
|
if attached {JSON_NUMBER} parser.parse as l_jn then
|
|
|
|
jn ?= parser.parse
|
|
|
|
if attached {INTEGER_8} json.object (jn, Void) as l_i8 then
|
|
|
|
assert ("jn /= Void", jn /= Void)
|
|
|
|
assert ("l_i8 = 42", l_i8 = 42)
|
|
|
|
i8 := 0
|
|
|
|
else
|
|
|
|
i8 ?= json.object (jn, Void)
|
|
|
|
assert ("json.object (jn, Void) is a INTEGER_8", False)
|
|
|
|
assert ("i8 = 42", i8 = 42)
|
|
|
|
end
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
assert ("parser.parse is a JSON_NUMBER", False)
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
test_json_number_and_integer_16
|
|
|
|
test_json_number_and_integer_16
|
|
|
|
local
|
|
|
|
local
|
|
|
|
i16: INTEGER_16
|
|
|
|
i16: INTEGER_16
|
|
|
|
jn: detachable JSON_NUMBER
|
|
|
|
jn: JSON_NUMBER
|
|
|
|
jrep: STRING
|
|
|
|
jrep: STRING
|
|
|
|
parser: JSON_PARSER
|
|
|
|
parser: JSON_PARSER
|
|
|
|
do
|
|
|
|
do
|
|
|
|
i16 := 300
|
|
|
|
i16 := 300
|
|
|
|
-- Eiffel value -> JSON value -> JSON representation
|
|
|
|
-- Eiffel value -> JSON value -> JSON representation
|
|
|
|
create jn.make_integer (i16)
|
|
|
|
create jn.make_integer (i16)
|
|
|
|
assert ("jn /= Void", jn /= Void)
|
|
|
|
assert ("jn.representation.same_string (%"300%")", jn.representation.same_string ("300"))
|
|
|
|
assert ("jn.representation.is_equal (%"300%")", jn.representation.is_equal ("300"))
|
|
|
|
|
|
|
|
-- Eiffel value -> JSON with factory
|
|
|
|
-- Eiffel value -> JSON with factory
|
|
|
|
jn := Void
|
|
|
|
if attached {JSON_NUMBER} json.value (i16) as l_jn then
|
|
|
|
jn ?= json.value (i16)
|
|
|
|
assert ("l_jn.representation.same_string (%"300%")", l_jn.representation.same_string ("300"))
|
|
|
|
assert ("jn /= Void", jn /= Void)
|
|
|
|
else
|
|
|
|
if attached jn as l_jn then
|
|
|
|
assert ("json.value (i16) is a JSON_NUMBER", False)
|
|
|
|
assert ("jn.representation.is_equal (%"300%")", l_jn.representation.is_equal ("300"))
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
-- JSON representation -> JSON value -> Eiffel value
|
|
|
|
-- JSON representation -> JSON value -> Eiffel value
|
|
|
@@ -103,32 +102,33 @@ feature -- Test
|
|
|
|
-- we know it is INTEGER_16 since the value is 300
|
|
|
|
-- we know it is INTEGER_16 since the value is 300
|
|
|
|
jrep := "300"
|
|
|
|
jrep := "300"
|
|
|
|
create parser.make_parser (jrep)
|
|
|
|
create parser.make_parser (jrep)
|
|
|
|
jn := Void
|
|
|
|
if attached {JSON_NUMBER} parser.parse as l_jn then
|
|
|
|
jn ?= parser.parse
|
|
|
|
if attached {INTEGER_16} json.object (jn, Void) as l_i16 then
|
|
|
|
assert ("jn /= Void", jn /= Void)
|
|
|
|
assert ("l_i16 = 300", l_i16 = 300)
|
|
|
|
i16 := 0
|
|
|
|
else
|
|
|
|
i16 ?= json.object (jn, Void)
|
|
|
|
assert ("json.object (jn, Void) is a INTEGER_16", False)
|
|
|
|
assert ("i16 = 300", i16 = 300)
|
|
|
|
end
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
assert ("parser.parse is a JSON_NUMBER", False)
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
test_json_number_and_integer_32
|
|
|
|
test_json_number_and_integer_32
|
|
|
|
local
|
|
|
|
local
|
|
|
|
i32: INTEGER_32
|
|
|
|
i32: INTEGER_32
|
|
|
|
jn: detachable JSON_NUMBER
|
|
|
|
jn: JSON_NUMBER
|
|
|
|
jrep: STRING
|
|
|
|
jrep: STRING
|
|
|
|
parser: JSON_PARSER
|
|
|
|
parser: JSON_PARSER
|
|
|
|
do
|
|
|
|
do
|
|
|
|
i32 := 100000
|
|
|
|
i32 := 100000
|
|
|
|
-- Eiffel value -> JSON representation -> JSON value
|
|
|
|
-- Eiffel value -> JSON representation -> JSON value
|
|
|
|
create jn.make_integer (i32)
|
|
|
|
create jn.make_integer (i32)
|
|
|
|
assert ("jn /= Void", jn /= Void)
|
|
|
|
assert ("jn.representation.same_string (%"100000%")", jn.representation.same_string ("100000"))
|
|
|
|
assert ("jn.representation.is_equal (%"100000%")", jn.representation.is_equal ("100000"))
|
|
|
|
|
|
|
|
-- Eiffel value -> JSON representation -> JSON value with factory
|
|
|
|
-- Eiffel value -> JSON representation -> JSON value with factory
|
|
|
|
jn := Void
|
|
|
|
if attached {JSON_NUMBER} json.value (i32) as l_jn then
|
|
|
|
jn ?= json.value (i32)
|
|
|
|
assert ("l_jn.representation.same_string (%"100000%")", l_jn.representation.same_string ("100000"))
|
|
|
|
assert ("jn /= Void", jn /= Void)
|
|
|
|
else
|
|
|
|
if attached jn as l_jn then
|
|
|
|
assert ("json.value (i32) is a JSON_NUMBER", False)
|
|
|
|
assert ("jn.representation.is_equal (%"100000%")", l_jn.representation.is_equal ("100000"))
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
-- JSON representation -> JSON value -> Eiffel value
|
|
|
|
-- JSON representation -> JSON value -> Eiffel value
|
|
|
@@ -137,32 +137,33 @@ feature -- Test
|
|
|
|
-- we know it is INTEGER_32 since the value is 100000
|
|
|
|
-- we know it is INTEGER_32 since the value is 100000
|
|
|
|
jrep := "100000"
|
|
|
|
jrep := "100000"
|
|
|
|
create parser.make_parser (jrep)
|
|
|
|
create parser.make_parser (jrep)
|
|
|
|
jn := Void
|
|
|
|
if attached {JSON_NUMBER} parser.parse as l_jn then
|
|
|
|
jn ?= parser.parse
|
|
|
|
if attached {INTEGER_32} json.object (jn, Void) as l_i32 then
|
|
|
|
assert ("jn /= Void", jn /= Void)
|
|
|
|
assert ("l_i32 = 100000", l_i32 = 100000)
|
|
|
|
i32 := 0
|
|
|
|
else
|
|
|
|
i32 ?= json.object (jn, Void)
|
|
|
|
assert ("json.object (jn, Void) is a INTEGER_32", False)
|
|
|
|
assert ("i32 = 100000", i32 = 100000)
|
|
|
|
end
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
assert ("parser.parse is a JSON_NUMBER", False)
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
test_json_number_and_integer_64
|
|
|
|
test_json_number_and_integer_64
|
|
|
|
local
|
|
|
|
local
|
|
|
|
i64: INTEGER_64
|
|
|
|
i64: INTEGER_64
|
|
|
|
jn: detachable JSON_NUMBER
|
|
|
|
jn: JSON_NUMBER
|
|
|
|
jrep: STRING
|
|
|
|
jrep: STRING
|
|
|
|
parser: JSON_PARSER
|
|
|
|
parser: JSON_PARSER
|
|
|
|
do
|
|
|
|
do
|
|
|
|
i64 := 42949672960
|
|
|
|
i64 := 42949672960
|
|
|
|
-- Eiffel value -> JSON value -> JSON representation
|
|
|
|
-- Eiffel value -> JSON value -> JSON representation
|
|
|
|
create jn.make_integer (i64)
|
|
|
|
create jn.make_integer (i64)
|
|
|
|
assert ("jn /= Void", jn /= Void)
|
|
|
|
assert ("jn.representation.same_string (%"42949672960%")", jn.representation.same_string ("42949672960"))
|
|
|
|
assert ("jn.representation.is_equal (%"42949672960%")", jn.representation.is_equal ("42949672960"))
|
|
|
|
|
|
|
|
-- Eiffel value -> JSON value -> JSON representation with factory
|
|
|
|
-- Eiffel value -> JSON value -> JSON representation with factory
|
|
|
|
jn := Void
|
|
|
|
if attached {JSON_NUMBER} json.value (i64) as l_jn then
|
|
|
|
jn ?= json.value (i64)
|
|
|
|
assert ("l_jn.representation.same_string (%"42949672960%")", l_jn.representation.same_string ("42949672960"))
|
|
|
|
assert ("jn /= Void", jn /= Void)
|
|
|
|
else
|
|
|
|
if attached jn as l_jn then
|
|
|
|
assert ("json.value (i64) is a JSON_NUMBER", False)
|
|
|
|
assert ("jn.representation.is_equal (%"42949672960%")", l_jn.representation.is_equal ("42949672960"))
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
-- JSON representation -> JSON value -> Eiffel value
|
|
|
|
-- JSON representation -> JSON value -> Eiffel value
|
|
|
@@ -171,33 +172,33 @@ feature -- Test
|
|
|
|
-- we know it is INTEGER_32 since the value is 42949672960
|
|
|
|
-- we know it is INTEGER_32 since the value is 42949672960
|
|
|
|
jrep := "42949672960"
|
|
|
|
jrep := "42949672960"
|
|
|
|
create parser.make_parser (jrep)
|
|
|
|
create parser.make_parser (jrep)
|
|
|
|
jn := Void
|
|
|
|
if attached {JSON_NUMBER} parser.parse as l_jn then
|
|
|
|
jn ?= parser.parse
|
|
|
|
if attached {INTEGER_64} json.object (jn, Void) as l_i64 then
|
|
|
|
assert ("jn /= Void", jn /= Void)
|
|
|
|
assert ("l_i64 = 42949672960", l_i64 = 42949672960)
|
|
|
|
i64 := 0
|
|
|
|
else
|
|
|
|
i64 ?= json.object (jn, Void)
|
|
|
|
assert ("json.object (jn, Void) is a INTEGER_64", False)
|
|
|
|
assert ("i64 = 42949672960", i64 = 42949672960)
|
|
|
|
end
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
assert ("parser.parse is a JSON_NUMBER", False)
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
test_json_number_and_natural_8
|
|
|
|
test_json_number_and_natural_8
|
|
|
|
local
|
|
|
|
local
|
|
|
|
n8: NATURAL_8
|
|
|
|
n8: NATURAL_8
|
|
|
|
i16: INTEGER_16
|
|
|
|
jn: JSON_NUMBER
|
|
|
|
jn: detachable JSON_NUMBER
|
|
|
|
|
|
|
|
jrep: STRING
|
|
|
|
jrep: STRING
|
|
|
|
parser: JSON_PARSER
|
|
|
|
parser: JSON_PARSER
|
|
|
|
do
|
|
|
|
do
|
|
|
|
n8 := 200
|
|
|
|
n8 := 200
|
|
|
|
-- Eiffel value -> JSON value -> JSON representation
|
|
|
|
-- Eiffel value -> JSON value -> JSON representation
|
|
|
|
create jn.make_natural (n8)
|
|
|
|
create jn.make_natural (n8)
|
|
|
|
assert ("jn /= Void", jn /= Void)
|
|
|
|
assert ("jn.representation.same_string (%"200%")", jn.representation.same_string ("200"))
|
|
|
|
assert ("jn.representation.is_equal (%"200%")", jn.representation.is_equal ("200"))
|
|
|
|
|
|
|
|
-- Eiffel value -> JSON value -> JSON representation with factory
|
|
|
|
-- Eiffel value -> JSON value -> JSON representation with factory
|
|
|
|
jn := Void
|
|
|
|
if attached {JSON_NUMBER} json.value (n8) as l_jn then
|
|
|
|
jn ?= json.value (n8)
|
|
|
|
assert ("l_jn.representation.same_string (%"200%")", l_jn.representation.same_string ("200"))
|
|
|
|
assert ("jn /= Void", jn /= Void)
|
|
|
|
else
|
|
|
|
if attached jn as l_jn then
|
|
|
|
assert ("json.value (n8) is a JSON_NUMBER}", False)
|
|
|
|
assert ("jn.representation.is_equal (%"200%")", l_jn.representation.is_equal ("200"))
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
-- JSON representation -> JSON value -> Eiffel value
|
|
|
|
-- JSON representation -> JSON value -> Eiffel value
|
|
|
@@ -206,33 +207,33 @@ feature -- Test
|
|
|
|
-- we know it is INTEGER_16 since the value is 200
|
|
|
|
-- we know it is INTEGER_16 since the value is 200
|
|
|
|
jrep := "200"
|
|
|
|
jrep := "200"
|
|
|
|
create parser.make_parser (jrep)
|
|
|
|
create parser.make_parser (jrep)
|
|
|
|
jn := Void
|
|
|
|
if attached {JSON_NUMBER} parser.parse as l_jn then
|
|
|
|
jn ?= parser.parse
|
|
|
|
if attached {INTEGER_16} json.object (jn, Void) as i16 then
|
|
|
|
assert ("jn /= Void", jn /= Void)
|
|
|
|
assert ("i16 = 200", i16 = 200)
|
|
|
|
i16 := 0
|
|
|
|
else
|
|
|
|
i16 ?= json.object (jn, Void)
|
|
|
|
assert ("json.object (jn, Void) is an INTEGER_16", False)
|
|
|
|
assert ("i16 = 200", i16 = 200)
|
|
|
|
end
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
assert ("parser.parse is a JSON_NUMBER", False)
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
test_json_number_and_natural_16
|
|
|
|
test_json_number_and_natural_16
|
|
|
|
local
|
|
|
|
local
|
|
|
|
n16: NATURAL_16
|
|
|
|
n16: NATURAL_16
|
|
|
|
i32: INTEGER_32
|
|
|
|
jn: JSON_NUMBER
|
|
|
|
jn: detachable JSON_NUMBER
|
|
|
|
|
|
|
|
jrep: STRING
|
|
|
|
jrep: STRING
|
|
|
|
parser: JSON_PARSER
|
|
|
|
parser: JSON_PARSER
|
|
|
|
do
|
|
|
|
do
|
|
|
|
n16 := 32768
|
|
|
|
n16 := 32768
|
|
|
|
-- Eiffel value -> JSON value -> JSON representation
|
|
|
|
-- Eiffel value -> JSON value -> JSON representation
|
|
|
|
create jn.make_natural (n16)
|
|
|
|
create jn.make_natural (n16)
|
|
|
|
assert ("jn /= Void", jn /= Void)
|
|
|
|
assert ("jn.representation.same_string (%"32768%")", jn.representation.same_string ("32768"))
|
|
|
|
assert ("jn.representation.is_equal (%"32768%")", jn.representation.is_equal ("32768"))
|
|
|
|
|
|
|
|
-- Eiffel value -> JSON value -> JSON representation with factory
|
|
|
|
-- Eiffel value -> JSON value -> JSON representation with factory
|
|
|
|
jn := Void
|
|
|
|
if attached {JSON_NUMBER} json.value (n16) as l_jn then
|
|
|
|
jn ?= json.value (n16)
|
|
|
|
assert ("l_jn.representation.same_string (%"32768%")", l_jn.representation.same_string ("32768"))
|
|
|
|
assert ("jn /= Void", jn /= Void)
|
|
|
|
else
|
|
|
|
if attached jn as l_jn then
|
|
|
|
assert ("json.value (n16) is a JSON_NUMBER", False)
|
|
|
|
assert ("jn.representation.is_equal (%"32768%")", l_jn.representation.is_equal ("32768"))
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
-- JSON representation -> JSON value -> Eiffel value
|
|
|
|
-- JSON representation -> JSON value -> Eiffel value
|
|
|
@@ -241,33 +242,33 @@ feature -- Test
|
|
|
|
-- we know it is INTEGER_32 since the value is 32768
|
|
|
|
-- we know it is INTEGER_32 since the value is 32768
|
|
|
|
jrep := "32768"
|
|
|
|
jrep := "32768"
|
|
|
|
create parser.make_parser (jrep)
|
|
|
|
create parser.make_parser (jrep)
|
|
|
|
jn := Void
|
|
|
|
if attached {JSON_NUMBER} parser.parse as l_jn then
|
|
|
|
jn ?= parser.parse
|
|
|
|
if attached {INTEGER_32} json.object (jn, Void) as i32 then
|
|
|
|
assert ("jn /= Void", jn /= Void)
|
|
|
|
assert ("i32 = 32768", i32 = 32768)
|
|
|
|
i32 := 0
|
|
|
|
else
|
|
|
|
i32 ?= json.object (jn, Void)
|
|
|
|
assert ("json.object (jn, Void) is a INTEGER_32", False)
|
|
|
|
assert ("i32 = 32768", i32 = 32768)
|
|
|
|
end
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
assert ("parser.parse is a JSON_NUMBER", False)
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
test_json_number_and_natural_32
|
|
|
|
test_json_number_and_natural_32
|
|
|
|
local
|
|
|
|
local
|
|
|
|
n32: NATURAL_32
|
|
|
|
n32: NATURAL_32
|
|
|
|
i64: INTEGER_64
|
|
|
|
jn: JSON_NUMBER
|
|
|
|
jn: detachable JSON_NUMBER
|
|
|
|
|
|
|
|
jrep: STRING
|
|
|
|
jrep: STRING
|
|
|
|
parser: JSON_PARSER
|
|
|
|
parser: JSON_PARSER
|
|
|
|
do
|
|
|
|
do
|
|
|
|
n32 := 2147483648
|
|
|
|
n32 := 2147483648
|
|
|
|
-- Eiffel value -> JSON value -> JSON representation
|
|
|
|
-- Eiffel value -> JSON value -> JSON representation
|
|
|
|
create jn.make_natural (n32)
|
|
|
|
create jn.make_natural (n32)
|
|
|
|
assert ("jn /= Void", jn /= Void)
|
|
|
|
assert ("jn.representation.same_string (%"2147483648%")", jn.representation.same_string ("2147483648"))
|
|
|
|
assert ("jn.representation.is_equal (%"2147483648%")", jn.representation.is_equal ("2147483648"))
|
|
|
|
|
|
|
|
-- Eiffel value -> JSON value -> JSON representation with factory
|
|
|
|
-- Eiffel value -> JSON value -> JSON representation with factory
|
|
|
|
jn := Void
|
|
|
|
if attached json.value (n32) as l_jn then
|
|
|
|
jn ?= json.value (n32)
|
|
|
|
assert ("l_jn.representation.same_string (%"2147483648%")", l_jn.representation.same_string ("2147483648"))
|
|
|
|
assert ("jn /= Void", jn /= Void)
|
|
|
|
else
|
|
|
|
if attached jn as l_jn then
|
|
|
|
assert ("json.value (n32) is a JSON_NUMBER", False)
|
|
|
|
assert ("jn.representation.is_equal (%"2147483648%")", jn.representation.is_equal ("2147483648"))
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
-- JSON representation -> JSON value -> Eiffel value
|
|
|
|
-- JSON representation -> JSON value -> Eiffel value
|
|
|
@@ -276,32 +277,33 @@ feature -- Test
|
|
|
|
-- we know it is INTEGER_64 since the value is 2147483648
|
|
|
|
-- we know it is INTEGER_64 since the value is 2147483648
|
|
|
|
jrep := "2147483648"
|
|
|
|
jrep := "2147483648"
|
|
|
|
create parser.make_parser (jrep)
|
|
|
|
create parser.make_parser (jrep)
|
|
|
|
jn := Void
|
|
|
|
if attached {JSON_NUMBER} parser.parse as l_jn then
|
|
|
|
jn ?= parser.parse
|
|
|
|
if attached {INTEGER_64} json.object (jn, Void) as i64 then
|
|
|
|
assert ("jn /= Void", jn /= Void)
|
|
|
|
assert ("i64 = 2147483648", i64 = 2147483648)
|
|
|
|
i64 := 0
|
|
|
|
else
|
|
|
|
i64 ?= json.object (jn, Void)
|
|
|
|
assert ("json.object (jn, Void) is a INTEGER_64", False)
|
|
|
|
assert ("i64 = 2147483648", i64 = 2147483648)
|
|
|
|
end
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
assert ("parser.parse is a JSON_NUMBER", False)
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
test_json_number_and_large_integers
|
|
|
|
test_json_number_and_large_integers
|
|
|
|
local
|
|
|
|
local
|
|
|
|
jrep: STRING
|
|
|
|
jrep: STRING
|
|
|
|
jn: detachable JSON_NUMBER
|
|
|
|
|
|
|
|
n64: NATURAL_64
|
|
|
|
n64: NATURAL_64
|
|
|
|
|
|
|
|
jn: JSON_NUMBER
|
|
|
|
parser: JSON_PARSER
|
|
|
|
parser: JSON_PARSER
|
|
|
|
do
|
|
|
|
do
|
|
|
|
n64 := 9223372036854775808
|
|
|
|
n64 := 9223372036854775808
|
|
|
|
-- Eiffel value -> JSON value -> JSON representation
|
|
|
|
-- Eiffel value -> JSON value -> JSON representation
|
|
|
|
create jn.make_natural (n64)
|
|
|
|
create jn.make_natural (n64)
|
|
|
|
assert ("jn /= Void", jn /= Void)
|
|
|
|
assert ("jn.representation.same_string (%"9223372036854775808%")", jn.representation.same_string ("9223372036854775808"))
|
|
|
|
assert ("jn.representation.is_equal (%"9223372036854775808%")", jn.representation.is_equal ("9223372036854775808"))
|
|
|
|
|
|
|
|
jn := Void
|
|
|
|
|
|
|
|
-- Eiffel value -> JSON value -> JSON representation with factory
|
|
|
|
-- Eiffel value -> JSON value -> JSON representation with factory
|
|
|
|
jn ?= json.value (n64)
|
|
|
|
if attached {JSON_NUMBER} json.value (n64) as l_jn then
|
|
|
|
assert ("jn /= Void", jn /= Void)
|
|
|
|
assert ("l_jn.representation.same_string (%"9223372036854775808%")", l_jn.representation.same_string ("9223372036854775808"))
|
|
|
|
if attached jn as l_jn then
|
|
|
|
else
|
|
|
|
assert ("jn.representation.is_equal (%"9223372036854775808%")", l_jn.representation.is_equal ("9223372036854775808"))
|
|
|
|
assert ("json.value (n64) is a JSON_NUMBER", False)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
-- JSON representation -> JSON value -> Eiffel value
|
|
|
|
-- JSON representation -> JSON value -> Eiffel value
|
|
|
@@ -310,31 +312,33 @@ feature -- Test
|
|
|
|
-- we know it is INTEGER_32 since the value is 42949672960
|
|
|
|
-- we know it is INTEGER_32 since the value is 42949672960
|
|
|
|
jrep := "9223372036854775808" -- 1 higher than largest positive number that can be represented by INTEGER 64
|
|
|
|
jrep := "9223372036854775808" -- 1 higher than largest positive number that can be represented by INTEGER 64
|
|
|
|
create parser.make_parser (jrep)
|
|
|
|
create parser.make_parser (jrep)
|
|
|
|
jn := Void
|
|
|
|
if attached {JSON_NUMBER} parser.parse as l_jn then
|
|
|
|
jn ?= parser.parse
|
|
|
|
if attached {NATURAL_64} json.object (jn, Void) as l_n64 then
|
|
|
|
assert ("jn /= Void", jn /= Void)
|
|
|
|
assert ("l_n64 = 9223372036854775808", l_n64 = 9223372036854775808)
|
|
|
|
n64 := 0
|
|
|
|
else
|
|
|
|
n64 ?= json.object (jn, Void)
|
|
|
|
assert ("json.object (jn, Void) is a NATURAL_64", False)
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
assert ("parser.parse is a JSON_NUMBER", False)
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
test_json_number_and_eiffel_real
|
|
|
|
test_json_number_and_eiffel_real
|
|
|
|
local
|
|
|
|
local
|
|
|
|
r: REAL
|
|
|
|
r: REAL
|
|
|
|
r64: REAL_64
|
|
|
|
jn: JSON_NUMBER
|
|
|
|
jn: detachable JSON_NUMBER
|
|
|
|
|
|
|
|
jrep: STRING
|
|
|
|
jrep: STRING
|
|
|
|
parser: JSON_PARSER
|
|
|
|
parser: JSON_PARSER
|
|
|
|
do
|
|
|
|
do
|
|
|
|
r := 3.14
|
|
|
|
r := 3.14
|
|
|
|
-- Eiffel value -> JSON value -> JSON representation
|
|
|
|
-- Eiffel value -> JSON value -> JSON representation
|
|
|
|
create jn.make_real (r)
|
|
|
|
create jn.make_real (r)
|
|
|
|
assert ("jn /= Void", jn /= Void)
|
|
|
|
assert ("jn.representation.same_string (%"3.1400001049041748%")", jn.representation.same_string ("3.1400001049041748"))
|
|
|
|
assert ("jn.representation.is_equal (%"3.1400001049041748%")", jn.representation.is_equal ("3.1400001049041748"))
|
|
|
|
|
|
|
|
-- Eiffel value -> JSON value -> JSON representation with factory
|
|
|
|
-- Eiffel value -> JSON value -> JSON representation with factory
|
|
|
|
jn ?= json.value (r)
|
|
|
|
if attached {JSON_NUMBER} json.value (r) as l_jn then
|
|
|
|
assert ("jn /= Void", jn /= Void)
|
|
|
|
assert ("l_jn.representation.same_string (%"3.1400001049041748%")", l_jn.representation.same_string ("3.1400001049041748"))
|
|
|
|
if attached jn as l_jn then
|
|
|
|
else
|
|
|
|
assert ("jn.representation.is_equal (%"3.1400001049041748%")", l_jn.representation.is_equal ("3.1400001049041748"))
|
|
|
|
assert ("json.value (r) is a JSON_NUMBER", False)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
-- JSON representation -> JSON value -> Eiffel value
|
|
|
|
-- JSON representation -> JSON value -> Eiffel value
|
|
|
@@ -342,124 +346,133 @@ feature -- Test
|
|
|
|
-- of the JSON number is a floating point number
|
|
|
|
-- of the JSON number is a floating point number
|
|
|
|
jrep := "3.14"
|
|
|
|
jrep := "3.14"
|
|
|
|
create parser.make_parser (jrep)
|
|
|
|
create parser.make_parser (jrep)
|
|
|
|
jn := Void
|
|
|
|
if attached {JSON_NUMBER} parser.parse as l_jn then
|
|
|
|
jn ?= parser.parse
|
|
|
|
if attached {REAL_64} json.object (jn, Void) as r64 then
|
|
|
|
assert ("jn /= Void", jn /= Void)
|
|
|
|
assert ("3.14 <= r64 and r64 <= 3.141", 3.14 <= r64 and r64 <= 3.141)
|
|
|
|
r64 := 0
|
|
|
|
else
|
|
|
|
r64 ?= json.object (jn, Void)
|
|
|
|
assert ("json.object (jn, Void) is a REAL_64", False)
|
|
|
|
assert ("r64 = 3.1400000000000001", r64 = 3.1400000000000001)
|
|
|
|
end
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
assert ("parser.parse is a JSON_NUMBER", False)
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
test_json_number_and_eiffel_real_32
|
|
|
|
test_json_number_and_eiffel_real_32
|
|
|
|
local
|
|
|
|
local
|
|
|
|
r32: REAL_32
|
|
|
|
r32: REAL_32
|
|
|
|
r64: REAL_64
|
|
|
|
jn: JSON_NUMBER
|
|
|
|
jn: detachable JSON_NUMBER
|
|
|
|
|
|
|
|
jrep: STRING
|
|
|
|
jrep: STRING
|
|
|
|
parser: JSON_PARSER
|
|
|
|
parser: JSON_PARSER
|
|
|
|
do
|
|
|
|
do
|
|
|
|
r32 := 3.14
|
|
|
|
r32 := 3.14
|
|
|
|
-- Eiffel value -> JSON value -> JSON representation
|
|
|
|
-- Eiffel value -> JSON value -> JSON representation
|
|
|
|
create jn.make_real (r32)
|
|
|
|
create jn.make_real (r32)
|
|
|
|
assert ("jn /= Void", jn /= Void)
|
|
|
|
assert ("jn.representation.same_string (%"3.1400001049041748%")", jn.representation.same_string ("3.1400001049041748"))
|
|
|
|
assert ("jn.representation.is_equal (%"3.1400001049041748%")", jn.representation.is_equal ("3.1400001049041748"))
|
|
|
|
|
|
|
|
-- Eiffel value -> JSON value -> JSON representation with factory
|
|
|
|
-- Eiffel value -> JSON value -> JSON representation with factory
|
|
|
|
jn ?= json.value (r32)
|
|
|
|
if attached {JSON_NUMBER} json.value (r32) as l_jn then
|
|
|
|
assert ("jn /= Void", jn /= Void)
|
|
|
|
assert ("l_jn.representation.same_string (%"3.1400001049041748%")", l_jn.representation.same_string ("3.1400001049041748"))
|
|
|
|
if attached jn as l_jn then
|
|
|
|
else
|
|
|
|
assert ("jn.representation.is_equal (%"3.1400001049041748%")", l_jn.representation.is_equal ("3.1400001049041748"))
|
|
|
|
assert ("json.value (r32) is a JSON_NUMBER", False)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
-- JSON representation -> JSON value -> Eiffel value
|
|
|
|
-- JSON representation -> JSON value -> Eiffel value
|
|
|
|
jrep := "3.1400001049041748"
|
|
|
|
jrep := "3.1400001049041748"
|
|
|
|
create parser.make_parser (jrep)
|
|
|
|
create parser.make_parser (jrep)
|
|
|
|
jn ?= parser.parse
|
|
|
|
if attached {JSON_NUMBER} parser.parse as l_jn then
|
|
|
|
assert ("jn /= Void", jn /= Void)
|
|
|
|
if attached {REAL_64} json.object (l_jn, Void) as r64 then
|
|
|
|
r64 := 0
|
|
|
|
assert ("r64 = 3.1400001049041748", r64 = 3.1400001049041748)
|
|
|
|
r64 ?= json.object (jn, Void)
|
|
|
|
else
|
|
|
|
assert ("r64 = 3.1400001049041748", r64 = 3.1400001049041748)
|
|
|
|
assert ("json.object (l_jn, Void) is a REAL_64", False)
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
assert ("parser.parse is a JSON_NUMBER", False)
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
test_json_number_and_eiffel_real_64
|
|
|
|
test_json_number_and_eiffel_real_64
|
|
|
|
local
|
|
|
|
local
|
|
|
|
r64: REAL_64
|
|
|
|
r64: REAL_64
|
|
|
|
jn: detachable JSON_NUMBER
|
|
|
|
jn: JSON_NUMBER
|
|
|
|
jrep: STRING
|
|
|
|
jrep: STRING
|
|
|
|
parser: JSON_PARSER
|
|
|
|
parser: JSON_PARSER
|
|
|
|
do
|
|
|
|
do
|
|
|
|
r64 := 3.1415926535897931
|
|
|
|
r64 := 3.1415926535897931
|
|
|
|
-- Eiffel value -> JSON value -> JSON representation
|
|
|
|
-- Eiffel value -> JSON value -> JSON representation
|
|
|
|
create jn.make_real (r64)
|
|
|
|
create jn.make_real (r64)
|
|
|
|
assert ("jn /= Void", jn /= Void)
|
|
|
|
assert ("jn.representation.same_string (%"3.1415926535897931%")", jn.representation.same_string ("3.1415926535897931"))
|
|
|
|
assert ("jn.representation.is_equal (%"3.1415926535897931%")", jn.representation.is_equal ("3.1415926535897931"))
|
|
|
|
|
|
|
|
-- Eiffel value -> JSON value -> JSON representation with factory
|
|
|
|
-- Eiffel value -> JSON value -> JSON representation with factory
|
|
|
|
jn ?= json.value (r64)
|
|
|
|
if attached {JSON_NUMBER} json.value (r64) as l_jn then
|
|
|
|
assert ("jn /= Void", jn /= Void)
|
|
|
|
assert ("l_jn.representation.same_string (%"3.1415926535897931%")", l_jn.representation.same_string ("3.1415926535897931"))
|
|
|
|
if attached jn as l_jn then
|
|
|
|
else
|
|
|
|
assert ("jn.representation.is_equal (%"3.1415926535897931%")", l_jn.representation.is_equal ("3.1415926535897931"))
|
|
|
|
assert ("json.value (r64) is a JSON_NUMBER", False)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
-- JSON representation -> JSON value -> Eiffel value
|
|
|
|
-- JSON representation -> JSON value -> Eiffel value
|
|
|
|
jrep := "3.1415926535897931"
|
|
|
|
jrep := "3.1415926535897931"
|
|
|
|
create parser.make_parser (jrep)
|
|
|
|
create parser.make_parser (jrep)
|
|
|
|
jn := Void
|
|
|
|
if attached {JSON_NUMBER} parser.parse as l_jn then
|
|
|
|
jn ?= parser.parse
|
|
|
|
if attached {REAL_64} json.object (jn, Void) as l_r64 then
|
|
|
|
assert ("jn /= Void", jn /= Void)
|
|
|
|
assert ("l_r64 = 3.1415926535897931", l_r64 = 3.1415926535897931)
|
|
|
|
r64 := 0
|
|
|
|
else
|
|
|
|
r64 ?= json.object (jn, Void)
|
|
|
|
assert ("json.object (jn, Void) is a REAL_64", False)
|
|
|
|
assert ("r64 = 3.1415926535897931", r64 = 3.1415926535897931)
|
|
|
|
end
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
assert ("parser.parse is a JSON_NUMBER", False)
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
test_json_boolean
|
|
|
|
test_json_boolean
|
|
|
|
local
|
|
|
|
local
|
|
|
|
b: BOOLEAN
|
|
|
|
|
|
|
|
jb: detachable JSON_BOOLEAN
|
|
|
|
|
|
|
|
jrep: STRING
|
|
|
|
|
|
|
|
parser: JSON_PARSER
|
|
|
|
parser: JSON_PARSER
|
|
|
|
|
|
|
|
jb: JSON_BOOLEAN
|
|
|
|
|
|
|
|
b: BOOLEAN
|
|
|
|
do
|
|
|
|
do
|
|
|
|
b := True
|
|
|
|
|
|
|
|
-- Eiffel value -> JSON value -> JSON representation
|
|
|
|
-- Eiffel value -> JSON value -> JSON representation
|
|
|
|
|
|
|
|
b := True
|
|
|
|
create jb.make_boolean (b)
|
|
|
|
create jb.make_boolean (b)
|
|
|
|
assert ("jb /= Void", jb /= Void)
|
|
|
|
|
|
|
|
assert ("jb.representation.is_equal (%"true%")", jb.representation.is_equal ("true"))
|
|
|
|
assert ("jb.representation.is_equal (%"true%")", jb.representation.is_equal ("true"))
|
|
|
|
-- Eiffel value -> JSON value -> JSON representation with factory
|
|
|
|
-- Eiffel value -> JSON value -> JSON representation with factory
|
|
|
|
jb ?= json.value (b)
|
|
|
|
if attached {JSON_BOOLEAN} json.value (b) as l_jb then
|
|
|
|
assert ("jb /= Void", jb /= Void)
|
|
|
|
assert ("l_jb.representation.same_string (%"true%")", l_jb.representation.same_string ("true"))
|
|
|
|
if attached jb as l_jb then
|
|
|
|
else
|
|
|
|
assert ("jb.representation.is_equal (%"true%")", l_jb.representation.is_equal ("true"))
|
|
|
|
assert ("l_jb /= Void", False)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
-- JSON representation -> JSON value -> Eiffel value
|
|
|
|
-- JSON representation -> JSON value -> Eiffel value
|
|
|
|
jrep := "true"
|
|
|
|
create parser.make_parser ("true")
|
|
|
|
create parser.make_parser (jrep)
|
|
|
|
if attached {JSON_BOOLEAN} parser.parse as l_jb then
|
|
|
|
jb := Void
|
|
|
|
if attached {BOOLEAN} json.object (l_jb, Void) as l_b then
|
|
|
|
jb ?= parser.parse
|
|
|
|
assert ("l_b = True", l_b = True)
|
|
|
|
assert ("jb /= Void", jb /= Void)
|
|
|
|
else
|
|
|
|
b := False
|
|
|
|
assert ("json.object (l_jb, Void) is BOOLEAN", False)
|
|
|
|
b ?= json.object (jb, Void)
|
|
|
|
end
|
|
|
|
assert ("b = True", b = True)
|
|
|
|
else
|
|
|
|
|
|
|
|
assert ("parser.parse is a JSON_BOOLEAN", False)
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
b := False
|
|
|
|
|
|
|
|
-- Eiffel value -> JSON value -> JSON representation
|
|
|
|
-- Eiffel value -> JSON value -> JSON representation
|
|
|
|
|
|
|
|
b := False
|
|
|
|
create jb.make_boolean (b)
|
|
|
|
create jb.make_boolean (b)
|
|
|
|
assert ("jb /= Void", jb /= Void)
|
|
|
|
assert ("jb.representation.same_string (%"false%")", jb.representation.same_string ("false"))
|
|
|
|
assert ("jb.representation.is_equal (%"false%")", jb.representation.is_equal ("false"))
|
|
|
|
|
|
|
|
-- Eiffel value -> JSON value -> JSON representation with factory
|
|
|
|
-- Eiffel value -> JSON value -> JSON representation with factory
|
|
|
|
jb ?= json.value (b)
|
|
|
|
if attached {JSON_BOOLEAN} json.value (b) as l_jb then
|
|
|
|
assert ("jb /= Void", jb /= Void)
|
|
|
|
assert ("l_jb.representation.same_string (%"false%")", l_jb.representation.same_string ("false"))
|
|
|
|
if attached jb as l_jb then
|
|
|
|
else
|
|
|
|
assert ("jb.representation.is_equal (%"false%")", l_jb.representation.is_equal ("false"))
|
|
|
|
assert ("json.value (b) is a JSON_BOOLEAN", False)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
-- JSON representation -> JSON value -> Eiffel value
|
|
|
|
-- JSON representation -> JSON value -> Eiffel value
|
|
|
|
jrep := "false"
|
|
|
|
create parser.make_parser ("false")
|
|
|
|
create parser.make_parser (jrep)
|
|
|
|
if attached {JSON_BOOLEAN} parser.parse as l_jb then
|
|
|
|
jb := Void
|
|
|
|
if attached {BOOLEAN} json.object (l_jb, Void) as l_b then
|
|
|
|
jb ?= parser.parse
|
|
|
|
assert ("l_b = False", l_b = False)
|
|
|
|
assert ("jb /= Void", jb /= Void)
|
|
|
|
else
|
|
|
|
b := True
|
|
|
|
assert ("json.object (l_jb, Void) is a BOOLEAN", False)
|
|
|
|
b ?= json.object (jb, Void)
|
|
|
|
end
|
|
|
|
assert ("b = False", b = False)
|
|
|
|
else
|
|
|
|
|
|
|
|
assert ("parser.parse is a JSON_BOOLEAN", False)
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
test_json_null
|
|
|
|
test_json_null
|
|
|
@@ -600,7 +613,6 @@ feature -- Test
|
|
|
|
jn: JSON_NUMBER
|
|
|
|
jn: JSON_NUMBER
|
|
|
|
jrep: STRING
|
|
|
|
jrep: STRING
|
|
|
|
parser: JSON_PARSER
|
|
|
|
parser: JSON_PARSER
|
|
|
|
i, n: INTEGER
|
|
|
|
|
|
|
|
do
|
|
|
|
do
|
|
|
|
-- Eiffel value -> JSON value -> JSON representation
|
|
|
|
-- Eiffel value -> JSON value -> JSON representation
|
|
|
|
create ll.make
|
|
|
|
create ll.make
|
|
|
|