From de0539546c253e35b3cf5542d4ae1f0471e4d6aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20K=2E=20Papp?= Date: Wed, 28 Sep 2022 13:54:19 +0200 Subject: [PATCH] fix tests --- test/runtests.jl | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/test/runtests.jl b/test/runtests.jl index a93989b..7e05575 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -2,7 +2,10 @@ using DisplayAs, MarkdownTables, Tables, Test table = [(a = 1, b = :b), (a = 2, b = :d)] -table_string = markdown_table(table, String) -@test table_string == "| *a* | *b* |\n|-----|-----|\n| 1 | `b` |\n| 2 | `d` |\n" -@test table |> markdown_table(String) == table_string +# get rid of whitespace for comparison +_normalize(str::AbstractString) = filter(x -> x ≠ ' ', str) + +table_string = _normalize(markdown_table(table, String)) +@test table_string == _normalize("| a | b |\n|---|-----|\n| 1 | `b` |\n| 2 | `d` |\n") +@test table |> markdown_table(String) |> _normalize == table_string @test markdown_table(table) isa DisplayAs.Raw.Showable{MIME"text/markdown"}