Skip to content

Commit 122a139

Browse files
author
Christopher Doris
committed
add tests for compact printing
1 parent 4f5b609 commit 122a139

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

test/Core.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -805,6 +805,9 @@ end
805805
@test sprint(show, MIME("text/plain"), Py(12)) == "Python: 12"
806806
# https://github.com/JuliaPy/PythonCall.jl/issues/522
807807
@test sprint(show, MIME("text/plain"), PythonCall.pynew()) == "Python: NULL"
808+
# test compact printing
809+
@test sprint(show, MIME("text/plain"), Py(String('A':'Z')), context=(:compact=>true, :displaysize=>(50, 20))) == "Py: 'ABCDE ... WXYZ'"
810+
@test sprint(show, MIME("text/plain"), Py(String('A':'Z')), context=(:compact=>true, :limit=>false, :displaysize=>(50, 20))) == "Py: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'"
808811
@test_throws MethodError sprint(show, MIME("text/html"), PythonCall.pynew())
809812
end
810813
end

0 commit comments

Comments
 (0)