Weave.jl/test/test_display.jl

29 lines
535 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
2021-04-29 13:12:08 +02:00
DataFrame(a=rand(10))
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)
2023-02-10 09:02:10 +01:00
@test count("<tr", doc.chunks[1].rich_output) == 12 # additonal 2 for name and type row
2020-05-16 16:25:44 +02:00
# limit
n = 100000
doc = mock_run("""
2020-05-16 16:25:44 +02:00
```julia
using DataFrames
2021-04-29 13:12:08 +02:00
DataFrame(a=rand($n))
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