|
202 | 202 | # create Value Card and get its type with boolean value |
203 | 203 | @test typeof(Card("BOOL", true)) <: Card{Value{Bool}} |
204 | 204 |
|
| 205 | + # create Value card with undefined value |
| 206 | + @test isequal(showfields(Card("UNDEF", missing)), |
| 207 | + ("UNDEF", missing, "", |
| 208 | + "UNDEF = ")) |
| 209 | + |
| 210 | + # create Value card with undefined value and comment. An undefined value has no |
| 211 | + # units, so no units field is written. |
| 212 | + @test isequal(showfields(Card("UNDEF", missing, "a comment")), |
| 213 | + ("UNDEF", missing, "a comment", |
| 214 | + "UNDEF = / a comment ")) |
| 215 | + |
| 216 | + # an undefined value card round trips through its image |
| 217 | + @test isequal(showfields(parse(Card, |
| 218 | + "UNDEF = / a comment ")), |
| 219 | + ("UNDEF", missing, "a comment", |
| 220 | + "UNDEF = / a comment ")) |
| 221 | + |
| 222 | + # a units string in the comment of an undefined value card is preserved |
| 223 | + @test isequal(showfields(Card("UNDEF", missing, "[m] a comment")), |
| 224 | + ("UNDEF", missing, "[m] a comment", |
| 225 | + "UNDEF = / [m] a comment ")) |
| 226 | + |
205 | 227 | # create Value card with boolean value, fixed-format |
206 | 228 | @test isequal(showfields(Card("BOOL", false)), |
207 | 229 | ("BOOL", false, "", |
|
0 commit comments