File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ function loadfile(T, file::File)
99end
1010
1111function loadfile (T, file:: TextFile )
12- replace (read (file. filename, String), " \r " => " " )
12+ replace (read (file. filename, String), " \r " => " " ) # ignore CRLF/LF difference
1313end
1414
1515function loadfile (:: Type{<:Number} , file:: File{format"TXT"} )
@@ -46,7 +46,7 @@ Convert `x` to a validate content for file data format `T`.
4646_convert (:: Type{<:DataFormat} , x; kw... ) = x
4747
4848# plain TXT
49- _convert (:: Type{DataFormat{:TXT}} , x; kw... ) = string (x)
49+ _convert (:: Type{DataFormat{:TXT}} , x; kw... ) = replace ( string (x), " \r " => " " ) # ignore CRLF/LF difference
5050_convert (:: Type{DataFormat{:TXT}} , x:: Number ; kw... ) = x
5151function _convert (:: Type{DataFormat{:TXT}} , x:: AbstractArray{<:AbstractString} ; kw... )
5252 return join (x, ' \n ' )
Original file line number Diff line number Diff line change 5757 @test_reference " references/string3.txt" 1338 by= (ref, x)-> isapprox (ref, x; atol= 10 )
5858 @test_reference " references/string4.txt" strip_summary (@io2str show (:: IO , MIME " text/plain" (), Int64 .(collect (1 : 5 ))))
5959
60+ # ignore CRLF/LF differences
61+ @test_reference " references/string5.txt" """
62+ This is a\r
63+ multiline string that does not end with a new line."""
6064 @test_reference " references/string5.txt" """
6165 This is a
6266 multiline string that does not end with a new line."""
You can’t perform that action at this time.
0 commit comments