|
40 | 40 | str4_arr = ["Hello\n\r world1", "Hello\n world2"] |
41 | 41 |
|
42 | 42 | # string as plain text |
43 | | - for fmt in (format"TXT", format"UNKNOWN") |
44 | | - # convert should respect whitespaces |
45 | | - @test str1 == ReferenceTests.maybe_encode(fmt, str1) |
46 | | - @test str2 == ReferenceTests.maybe_encode(fmt, str2) |
47 | | - # but ignore CRLF/LF differences |
48 | | - @test str2 == ReferenceTests.maybe_encode(fmt, str2_crlf) |
49 | | - # string arrays are treated as multi-line strings, even for UNKNOWN format |
50 | | - @test str3 == ReferenceTests.maybe_encode(fmt, str3) |
51 | | - @test str3 == ReferenceTests.maybe_encode(fmt, str3_arr1) |
52 | | - @test str3 == ReferenceTests.maybe_encode(fmt, str3_arr2) |
53 | | - # string arrays should ignore CRLF/LF differences, too |
54 | | - @test str4 == ReferenceTests.maybe_encode(fmt, str4_arr) |
55 | | - end |
| 43 | + fmt = format"TXT" |
| 44 | + # convert should respect whitespaces |
| 45 | + @test str1 == ReferenceTests.maybe_encode(fmt, str1) |
| 46 | + @test str2 == ReferenceTests.maybe_encode(fmt, str2) |
| 47 | + # but ignore CRLF/LF differences |
| 48 | + @test str2 == ReferenceTests.maybe_encode(fmt, str2_crlf) |
| 49 | + # string arrays are treated as multi-line strings, even for UNKNOWN format |
| 50 | + @test str3 == ReferenceTests.maybe_encode(fmt, str3) |
| 51 | + @test str3 == ReferenceTests.maybe_encode(fmt, str3_arr1) |
| 52 | + @test str3 == ReferenceTests.maybe_encode(fmt, str3_arr2) |
| 53 | + # string arrays should ignore CRLF/LF differences, too |
| 54 | + @test str4 == ReferenceTests.maybe_encode(fmt, str4_arr) |
56 | 55 |
|
57 | 56 | # string as SHA256 should also ignore CRLF/LF differences |
58 | 57 | fmt = format"SHA256" |
|
66 | 65 | @test str3_sha256 == ReferenceTests.maybe_encode(fmt, str3_arr2) |
67 | 66 | # string arrays should ignore CRLF/LF differences, too |
68 | 67 | @test str4_sha256 == ReferenceTests.maybe_encode(fmt, str4_arr) |
| 68 | + |
| 69 | + # unknown formats |
| 70 | + fmt = format"PNG" |
| 71 | + for str in (str1, str2, str2_crlf, str3, str3_arr1, str3_arr2) |
| 72 | + @test str === ReferenceTests.maybe_encode(fmt, str) |
| 73 | + end |
69 | 74 | end |
70 | 75 |
|
71 | 76 | @testset "numbers" begin |
|
0 commit comments