Skip to content

Commit 4dc3465

Browse files
authored
x.json2: fix tests for deprecated function fast_raw_decode (#24527)
1 parent 35d33ff commit 4dc3465

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

vlib/x/json2/decoder2/tests/json2_tests/decode_struct_test.v

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import x.json2.decoder2 as json
2-
import x.json2
32
import time
43

54
const fixed_time = time.new(

vlib/x/json2/decoder2/tests/json2_tests/json2_test.v

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ pub mut:
1717

1818
fn test_fast_raw_decode() {
1919
s := '{"name":"Peter","age":28,"salary":95000.5,"title":2}'
20-
o := json2.fast_raw_decode(s) or {
20+
o := json2.decode[json2.Any](s) or {
2121
assert false
2222
json2.Any('')
2323
}
2424
str := o.str()
25-
assert str == '{"name":"Peter","age":"28","salary":"95000.5","title":"2"}'
25+
assert str == '{"name":"Peter","age":28,"salary":95000.5,"title":2}'
2626
}
2727

2828
struct StructType[T] {

vlib/x/json2/tests/json2_test.v

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ pub mut:
1616

1717
fn test_fast_raw_decode() {
1818
s := '{"name":"Peter","age":28,"salary":95000.5,"title":2}'
19-
o := json.fast_raw_decode(s) or {
19+
o := json.decode[json.Any](s) or {
2020
assert false
2121
json.Any('')
2222
}
2323
str := o.str()
24-
assert str == '{"name":"Peter","age":"28","salary":"95000.5","title":"2"}'
24+
assert str == '{"name":"Peter","age":28,"salary":95000.5,"title":2}'
2525
}
2626

2727
fn test_character_unescape() {

0 commit comments

Comments
 (0)