mirror of
https://github.com/json-c/json-c.git
synced 2026-04-04 21:09:06 +08:00
Add tests for the json_object_array_del_idx() function.
This commit is contained in:
@@ -19,6 +19,25 @@ my_array=
|
||||
[3]=null
|
||||
[4]=5
|
||||
my_array.to_string()=[ 1, 2, 3, null, 5 ]
|
||||
my_array=
|
||||
[0]=1
|
||||
[1]=2
|
||||
[2]=3
|
||||
[3]=4
|
||||
[4]=5
|
||||
[5]=null
|
||||
[6]=7
|
||||
my_array.to_string()=[ 1, 2, 3, 4, 5, null, 7 ]
|
||||
after del_idx(0,1)=0, my_array.to_string()=[ 2, 3, 4, 5, null, 7 ]
|
||||
after del_idx(0,1)=0, my_array.to_string()=[ 3, 4, 5, null, 7 ]
|
||||
after del_idx(0,1)=0, my_array.to_string()=[ 4, 5, null, 7 ]
|
||||
after del_idx(0,1)=0, my_array.to_string()=[ 5, null, 7 ]
|
||||
after del_idx(0,1)=0, my_array.to_string()=[ null, 7 ]
|
||||
after del_idx(0,1)=0, my_array.to_string()=[ 7 ]
|
||||
after del_idx(0,1)=0, my_array.to_string()=[ ]
|
||||
after del_idx(0,1)=-1, my_array.to_string()=[ ]
|
||||
after del_idx(0,7)=0, my_array.to_string()=[ ]
|
||||
after del_idx(0,8)=-1, my_array.to_string()=[ 1, 2, 3, 4, 5, null, 7 ]
|
||||
my_array=
|
||||
[0]=3
|
||||
[1]=1
|
||||
|
||||
Reference in New Issue
Block a user