Commit 7e96a41
Paddy
Implement unit tests (#32)
* Test marshaling msgpack.
Test that the bytes produced from msgpack marshaling match the bytes cty
produces for equivalent msgpack marshaling. This hardcodes the bytes so
we don't have a dependency on cty.
* Fix dynamic tests.
* Make tests parallel.
* Test behavior of Value.As.
Add tests that assert we get the results we expect for given inputs of
the tftypes.Value.As method.
* Add tests for encoding and decoding types with JSON.
Add a test that will decode JSON from a hard-coded string and assert
that the type that was parsed is correct, then will encode the type and
ensure that the generated JSON is correct.
* Test Value.IsKnown() and Value.IsFullyKnown()
* Test WalkAttributePath.
* Move msgpack tests to tfprotov5, implement parsing.
Move our msgpack encoding tests to the tfprotov5 package, which led to
some unfortunate exports needing to be added to the tftypes package,
mostly the ValueComparer function.
But this lets us quickly and easily reuse those tests in the tfprotov5
package to test that our parsing of msgpack values is correct. We now
mimic the cty tests incredibly closely.
* Add tests for parsing JSON from DynamicValues.1 parent 958fd96 commit 7e96a41
File tree
12 files changed
+1716
-23
lines changed- tfprotov5
- tftypes
12 files changed
+1716
-23
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| 11 | + | |
10 | 12 | | |
11 | 13 | | |
12 | 14 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
| 32 | + | |
31 | 33 | | |
32 | 34 | | |
33 | 35 | | |
| |||
43 | 45 | | |
44 | 46 | | |
45 | 47 | | |
| 48 | + | |
| 49 | + | |
46 | 50 | | |
47 | 51 | | |
48 | 52 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
31 | | - | |
32 | 30 | | |
33 | 31 | | |
34 | 32 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
6 | 8 | | |
7 | 9 | | |
8 | 10 | | |
| |||
63 | 65 | | |
64 | 66 | | |
65 | 67 | | |
66 | | - | |
67 | | - | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
68 | 72 | | |
69 | 73 | | |
70 | 74 | | |
| |||
76 | 80 | | |
77 | 81 | | |
78 | 82 | | |
79 | | - | |
80 | | - | |
81 | | - | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
82 | 96 | | |
83 | | - | |
84 | | - | |
| 97 | + | |
85 | 98 | | |
86 | 99 | | |
87 | 100 | | |
| |||
94 | 107 | | |
95 | 108 | | |
96 | 109 | | |
97 | | - | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
98 | 129 | | |
99 | 130 | | |
100 | 131 | | |
| |||
201 | 232 | | |
202 | 233 | | |
203 | 234 | | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
204 | 243 | | |
205 | | - | |
| 244 | + | |
206 | 245 | | |
207 | 246 | | |
208 | 247 | | |
| |||
250 | 289 | | |
251 | 290 | | |
252 | 291 | | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
253 | 300 | | |
254 | | - | |
| 301 | + | |
255 | 302 | | |
256 | 303 | | |
257 | 304 | | |
| |||
0 commit comments