Weave.jl/test/test_display.jl

29 lines
536 B
Julia
Raw Normal View History

2020-05-16 16:25:44 +02:00
@testset "limit HMTL output" begin
@static VERSION v"1.4" && let
# no limit
doc = mock_run("""
2020-05-16 16:25:44 +02:00
```julia
using DataFrames
DataFrame(rand(10,3))
```
"""; doctype = "md2html")
2020-05-16 16:25:44 +02:00
@test isdefined(doc.chunks[1], :rich_output)
@test count("<tr>", doc.chunks[1].rich_output) == 12 # additonal 2 for name and type row
# limit
n = 100000
doc = mock_run("""
2020-05-16 16:25:44 +02:00
```julia
using DataFrames
DataFrame(rand($n,3))
2020-05-16 16:25:44 +02:00
```
"""; doctype = "md2html")
2020-05-16 16:25:44 +02:00
@test isdefined(doc.chunks[1], :rich_output)
@test count("<tr>", doc.chunks[1].rich_output) < n
end
end