|
33 | 33 | @testset "BlockScalars.jl" begin
|
34 | 34 | @testset "block: $test" for (test, str) in TEST_STRINGS
|
35 | 35 | @testset "literal" begin
|
36 |
| - @test block(str, "lk") == yaml_block(str, "|+") |
37 |
| - @test block(str, "lc") == yaml_block(str, "|") |
38 |
| - @test block(str, "ls") == yaml_block(str, "|-") |
| 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, "|-") |
39 | 39 | end
|
40 | 40 |
|
41 | 41 | @testset "folding" begin
|
42 |
| - @test block(str, "fk") == yaml_block(str, ">+") |
43 |
| - @test block(str, "fc") == yaml_block(str, ">") |
44 |
| - @test block(str, "fs") == yaml_block(str, ">-") |
| 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, ">-") |
45 | 45 | end
|
46 | 46 |
|
47 |
| - @testset "default style" begin |
48 |
| - @test block(str, "k") == yaml_block(str, ">+") |
49 |
| - @test block(str, "c") == yaml_block(str, ">") |
50 |
| - @test block(str, "s") == yaml_block(str, ">-") |
| 47 | + @testset "default chomp" begin |
| 48 | + @test block(str, :literal) == yaml_block(str, "|-") |
| 49 | + @test block(str, :folded) == yaml_block(str, ">-") |
51 | 50 | end
|
52 | 51 |
|
53 |
| - @testset "default chomp" begin |
54 |
| - @test block(str, "l") == yaml_block(str, "|-") |
55 |
| - @test block(str, "f") == yaml_block(str, ">-") |
| 52 | + @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, ">-") |
56 | 56 | end
|
57 | 57 |
|
58 | 58 | @testset "default" begin
|
59 | 59 | @test block(str) == yaml_block(str, ">-")
|
60 | 60 | end
|
61 | 61 | end
|
62 | 62 |
|
63 |
| - @testset "block invalid indicator" begin |
64 |
| - @test_throws ArgumentError block("", "fs_") # Too many indicators |
65 |
| - @test_throws ArgumentError block("", "sf") # Order matters |
66 |
| - @test_throws ArgumentError block("", "_s") # Invalid style |
67 |
| - @test_throws ArgumentError block("", "f_") # Invalid chomp |
68 |
| - @test_throws ArgumentError block("", "_") # Invalid style/chomp |
| 63 | + # @testset "block invalid indicator" begin |
| 64 | + # @test_throws ArgumentError block("", "fs_") # Too many indicators |
| 65 | + # @test_throws ArgumentError block("", "sf") # Order matters |
| 66 | + # @test_throws ArgumentError block("", "_s") # Invalid style |
| 67 | + # @test_throws ArgumentError block("", "f_") # Invalid chomp |
| 68 | + # @test_throws ArgumentError block("", "_") # Invalid style/chomp |
| 69 | + # end |
| 70 | + |
| 71 | + @testset "@blk_str" begin |
| 72 | + @testset "invalid indicators" begin |
| 73 | + @test_throws LoadError macroexpand(@__MODULE__, :(@blk_str "" "fs_")) # Too many indicators |
| 74 | + @test_throws LoadError macroexpand(@__MODULE__, :(@blk_str "" "sf")) # Order matters |
| 75 | + @test_throws LoadError macroexpand(@__MODULE__, :(@blk_str "" "_s")) # Invalid style |
| 76 | + @test_throws LoadError macroexpand(@__MODULE__, :(@blk_str "" "f_")) # Invalid chomp |
| 77 | + @test_throws LoadError macroexpand(@__MODULE__, :(@blk_str "" "_")) # Invalid style/chomp |
| 78 | + end |
69 | 79 | end
|
70 | 80 | end
|
0 commit comments