@@ -2,125 +2,114 @@ import:
22 java.util.HashMap
33
44on load:
5- set scoped {-key} to namespaced-key "plugin:test_pdt"
5+ set scoped {-key} to "plugin:test_pdt"
66
77after each test:
8- delete scoped {-key} within test-world if scoped {-key} is set
9-
10- test "pdc basic set/get with typed pdt":
11-
12- set scoped {-key} within test-world for pdt integer to 42
13- assert scoped {-key} within test-world for pdt integer is 42 with "typed pdt get failed"
14-
8+ event-script is current script
9+ delete namespaced-key scoped {-key} within test-world if scoped {-key} is set
10+
11+ # since we use after each test we have to use devdinc test pattern here
1512
16- test "pdc overwrite typed value ":
13+ devdinc test "pdc basic set/get with typed pdt ":
1714
18- set scoped {-key} within test-world for pdt string to "a"
19- set scoped {-key} within test-world for pdt string to "b "
15+ set namespaced-key scoped {-key} within test-world for pdt integer to 42
16+ assert namespaced-key scoped {-key} within test-world for pdt integer is 42 with "typed pdt get failed "
2017
21- assert scoped {-key} within test-world for pdt string is "b" with " overwrite failed"
18+ devdinc test "pdc overwrite typed value":
2219
20+ set namespaced-key scoped {-key} within test-world for pdt string to "a"
21+ set namespaced-key scoped {-key} within test-world for pdt string to "b"
2322
24- test "pdc delete typed value":
25- set scoped {-key} within test-world for pdt long to 100
26- delete scoped {-key} within test-world for pdt long
23+ assert namespaced-key scoped {-key} within test-world for pdt string is "b" with "overwrite failed"
2724
28- assert scoped {-key} within test-world for pdt long is not set with "delete failed"
25+ devdinc test "pdc delete typed value":
26+ set namespaced-key scoped {-key} within test-world for pdt long to 100
27+ delete namespaced-key scoped {-key} within test-world for pdt long
2928
29+ assert namespaced-key scoped {-key} within test-world for pdt long is not set with "delete failed"
3030
31- test "pdc object serialization (byte_array implicit)":
31+ devdinc test "pdc object serialization (byte_array implicit)":
3232
3333 set {_obj} to new HashMap()
3434 {_obj}.put("a", 1)
3535 {_obj}.put("b", 2)
3636
37- set scoped {-key} within test-world to {_obj}
37+ set namespaced-key scoped {-key} within test-world to {_obj}
3838
39- set {_out} to scoped {-key} within test-world
39+ set {_out} to namespaced-key scoped {-key} within test-world
4040 assert {_out}.get("a") is 1 with "object deserialize failed (a)"
4141 assert {_out}.get("b") is 2 with "object deserialize failed (b)"
4242
43+ devdinc test "pdc remove object via null":
4344
44- test "pdc remove object via null":
45+ set namespaced-key scoped {-key} within test-world to "temp"
46+ set namespaced-key scoped {-key} within test-world to null
4547
46- set scoped {-key} within test-world to "temp"
47- set scoped {-key} within test-world to null
48+ assert namespaced-key scoped {-key} within test-world is not set with "object remove via null failed"
4849
49- assert scoped {-key} within test-world is not set with "object remove via null failed"
50-
51-
52- test "pdc holder vs direct pdc equivalence":
50+ devdinc test "pdc holder vs direct pdc equivalence":
5351 set {_pdc} to test-world's pdc
5452
55- set scoped {-key} within test-world for pdt byte to 7
56- assert scoped {-key} within {_pdc} for pdt byte is 7 with "direct pdc access failed"
57-
58-
59- test "pdc boolean pdt":
53+ set namespaced-key scoped {-key} within test-world for pdt byte to 7
54+ assert namespaced-key scoped {-key} within {_pdc} for pdt byte is 7 with "direct pdc access failed"
6055
61- set scoped {-key} within test-world for pdt boolean to true
62- assert scoped {-key} within test-world for pdt boolean is true with "boolean pdt failed"
56+ devdinc test "pdc boolean pdt":
6357
58+ set namespaced-key scoped {-key} within test-world for pdt boolean to true
59+ assert namespaced-key scoped {-key} within test-world for pdt boolean is true with "boolean pdt failed"
6460
65- test "pdc default object missing returns none":
61+ devdinc test "pdc default object missing returns none":
6662
67- assert scoped {-key} within test-world is not set with "missing object did not return none"
63+ assert namespaced-key scoped {-key} within test-world is not set with "missing object did not return none"
6864
69- test "pdc unspecified pdt boolean":
65+ devdinc test "pdc unspecified pdt boolean":
7066
71- set scoped {-key} within test-world to true
72- assert scoped {-key} within test-world is true with "unspecified boolean failed"
67+ set namespaced-key scoped {-key} within test-world to true
68+ assert namespaced-key scoped {-key} within test-world is true with "unspecified boolean failed"
7369
70+ devdinc test "pdc unspecified pdt byte":
7471
75- test "pdc unspecified pdt byte":
72+ set namespaced-key scoped {-key} within test-world to 5
73+ assert namespaced-key scoped {-key} within test-world is 5 with "unspecified byte failed"
7674
77- set scoped {-key} within test-world to 5
78- assert scoped {-key} within test-world is 5 with "unspecified byte failed"
75+ devdinc test "pdc unspecified pdt short":
7976
77+ set namespaced-key scoped {-key} within test-world to 12
78+ assert namespaced-key scoped {-key} within test-world is 12 with "unspecified short failed"
8079
81- test "pdc unspecified pdt short ":
80+ devdinc test "pdc unspecified pdt integer ":
8281
83- set scoped {-key} within test-world to 12
84- assert scoped {-key} within test-world is 12 with "unspecified short failed"
82+ set namespaced-key scoped {-key} within test-world to 123
83+ assert namespaced-key scoped {-key} within test-world is 123 with "unspecified integer failed"
8584
85+ devdinc test "pdc unspecified pdt long":
8686
87- test "pdc unspecified pdt integer":
87+ set namespaced-key scoped {-key} within test-world to 123
88+ assert namespaced-key scoped {-key} within test-world is 123 with "unspecified long failed"
8889
89- set scoped {-key} within test-world to 123
90- assert scoped {-key} within test-world is 123 with "unspecified integer failed"
90+ devdinc test "pdc unspecified pdt float":
9191
92+ set namespaced-key scoped {-key} within test-world to 1.5
93+ assert namespaced-key scoped {-key} within test-world is 1.5 with "unspecified float failed"
9294
93- test "pdc unspecified pdt long":
94-
95- set scoped {-key} within test-world to 123
96- assert scoped {-key} within test-world is 123 with "unspecified long failed"
97-
98-
99- test "pdc unspecified pdt float":
100-
101- set scoped {-key} within test-world to 1.5
102- assert scoped {-key} within test-world is 1.5 with "unspecified float failed"
103-
104-
105- test "pdc unspecified pdt double":
95+ devdinc test "pdc unspecified pdt double":
10696
107- set scoped {-key} within test-world to 2.75
108- assert scoped {-key} within test-world is 2.75 with "unspecified double failed"
109-
97+ set namespaced-key scoped {-key} within test-world to 2.75
98+ assert namespaced-key scoped {-key} within test-world is 2.75 with "unspecified double failed"
11099
111- test "pdc unspecified pdt string":
112100
113- set scoped {-key} within test-world to "hello"
114- assert scoped {-key} within test-world is "hello" with "unspecified string failed"
101+ devdinc test "pdc unspecified pdt string":
115102
103+ set namespaced-key scoped {-key} within test-world to "hello"
104+ assert namespaced-key scoped {-key} within test-world is "hello" with "unspecified string failed"
116105
117- test "pdc unspecified pdt tag_container":
106+ devdinc test "pdc unspecified pdt tag_container":
118107
119108 set {_inner-pdc} to new pdc from test-world
120- set {_inner-key} to namespaced-key "plugin:inner_key"
121- set {_inner-key} within {_inner-pdc} for pdt integer to 9
109+ set {_inner-key} to "plugin:inner_key"
110+ set namespaced-key {_inner-key} within {_inner-pdc} for pdt integer to 9
122111
123- set scoped {-key} within test-world to {_inner-pdc}
112+ set namespaced-key scoped {-key} within test-world to {_inner-pdc}
124113
125- set {_out-pdc} to scoped {-key} within test-world
126- assert {_inner-key} within {_out-pdc} for pdt integer is 9 with "unspecified tag_container failed"
114+ set {_out-pdc} to namespaced-key scoped {-key} within test-world
115+ assert namespaced-key {_inner-key} within {_out-pdc} for pdt integer is 9 with "unspecified tag_container failed"
0 commit comments