|
32 | 32 |
|
33 | 33 | @testset "BlockScalars.jl" begin
|
34 | 34 | @testset "block: $test" for (test, str) in TEST_STRINGS
|
| 35 | + expected_lk = yaml_block(str, "|+") |
| 36 | + expected_lc = yaml_block(str, "|") |
| 37 | + expected_ls = yaml_block(str, "|-") |
| 38 | + |
| 39 | + expected_fk = yaml_block(str, ">+") |
| 40 | + expected_fc = yaml_block(str, ">") |
| 41 | + expected_fs = yaml_block(str, ">-") |
| 42 | + |
35 | 43 | @testset "literal" begin
|
36 |
| - @test block(str, :literal, :keep) == yaml_block(str, "|+") |
37 |
| - @test block(str, :literal, :clip) == yaml_block(str, "|") |
38 |
| - @test block(str, :literal, :strip) == yaml_block(str, "|-") |
| 44 | + @test block(str, :literal, :keep) == expected_lk |
| 45 | + @test block(str, :literal, :clip) == expected_lc |
| 46 | + @test block(str, :literal, :strip) == expected_ls |
| 47 | + |
| 48 | + @test block(str, style=:literal, chomp=:keep) == expected_lk |
| 49 | + @test block(str, style=:literal, chomp=:clip) == expected_lc |
| 50 | + @test block(str, style=:literal, chomp=:strip) == expected_ls |
39 | 51 | end
|
40 | 52 |
|
41 | 53 | @testset "folding" begin
|
42 |
| - @test block(str, :folded, :keep) == yaml_block(str, ">+") |
43 |
| - @test block(str, :folded, :clip) == yaml_block(str, ">") |
44 |
| - @test block(str, :folded, :strip) == yaml_block(str, ">-") |
| 54 | + @test block(str, :folded, :keep) == expected_fk |
| 55 | + @test block(str, :folded, :clip) == expected_fc |
| 56 | + @test block(str, :folded, :strip) == expected_fs |
| 57 | + |
| 58 | + @test block(str, style=:folded, chomp=:keep) == expected_fk |
| 59 | + @test block(str, style=:folded, chomp=:clip) == expected_fc |
| 60 | + @test block(str, style=:folded, chomp=:strip) == expected_fs |
45 | 61 | end
|
46 | 62 |
|
47 | 63 | @testset "default chomp" begin
|
48 |
| - @test block(str, :literal) == yaml_block(str, "|-") |
49 |
| - @test block(str, :folded) == yaml_block(str, ">-") |
| 64 | + @test block(str, :literal) == expected_ls |
| 65 | + @test block(str, :folded) == expected_fs |
| 66 | + |
| 67 | + @test block(str, style=:literal) == expected_ls |
| 68 | + @test block(str, style=:folded) == expected_fs |
50 | 69 | end
|
51 | 70 |
|
52 | 71 | @testset "default style" begin
|
53 |
| - @test block(str, chomp=:keep) == yaml_block(str, ">+") |
54 |
| - @test block(str, chomp=:clip) == yaml_block(str, ">") |
55 |
| - @test block(str, chomp=:strip) == yaml_block(str, ">-") |
| 72 | + @test block(str, chomp=:keep) == expected_fk |
| 73 | + @test block(str, chomp=:clip) == expected_fc |
| 74 | + @test block(str, chomp=:strip) == expected_fs |
56 | 75 | end
|
57 | 76 |
|
58 |
| - @testset "default" begin |
59 |
| - @test block(str) == yaml_block(str, ">-") |
| 77 | + @testset "default style/chomp" begin |
| 78 | + @test block(str) == expected_fs |
60 | 79 | end
|
61 | 80 | end
|
62 | 81 |
|
|
0 commit comments