@@ -1347,6 +1347,20 @@ test_repr("(:).a")
13471347@test repr (Tuple{Float64, Float64, Float64, Float64}) == " NTuple{4, Float64}"
13481348@test repr (Tuple{Float32, Float32, Float32}) == " Tuple{Float32, Float32, Float32}"
13491349
1350+ @testset " issue #42931" begin
1351+ @test repr (NTuple{4 , :A }) == " NTuple{4, :A}"
1352+ @test repr (NTuple{3 , :A }) == " Tuple{:A, :A, :A}"
1353+ @test repr (NTuple{2 , :A }) == " Tuple{:A, :A}"
1354+ @test repr (NTuple{1 , :A }) == " Tuple{:A}"
1355+ @test repr (NTuple{0 , :A }) == " Tuple{}"
1356+
1357+ @test repr (Tuple{:A , :A , :A , :B }) == " Tuple{:A, :A, :A, :B}"
1358+ @test repr (Tuple{:A , :A , :A , :A }) == " NTuple{4, :A}"
1359+ @test repr (Tuple{:A , :A , :A }) == " Tuple{:A, :A, :A}"
1360+ @test repr (Tuple{:A }) == " Tuple{:A}"
1361+ @test repr (Tuple{}) == " Tuple{}"
1362+ end
1363+
13501364# Test that REPL/mime display of invalid UTF-8 data doesn't throw an exception:
13511365@test isa (repr (" text/plain" , String (UInt8[0x00 : 0xff ;])), String)
13521366
0 commit comments