Skip to content

Commit

Permalink
Remove (c)transpose no-op for Strings and revise associated tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sacha0 committed Jul 8, 2016
1 parent 060a51c commit dd55ba5
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
2 changes: 0 additions & 2 deletions base/strings/basic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,6 @@ function length(s::AbstractString)
end
end

transpose(s::AbstractString) = s

## string comparison functions ##

function cmp(a::AbstractString, b::AbstractString)
Expand Down
2 changes: 1 addition & 1 deletion test/datafmt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ let i18n_data = ["Origin (English)", "Name (English)", "Origin (Native)", "Name
"Yugoslavia (Cyrillic)", "Djordje Balasevic", "Југославија", "Ђорђе Балашевић",
"Yugoslavia (Latin)", "Djordje Balasevic", "Jugoslavija", "Đorđe Balašević"]

i18n_arr = transpose(reshape(i18n_data, 4, Int(floor(length(i18n_data)/4))))
i18n_arr = permutedims(reshape(i18n_data, 4, Int(floor(length(i18n_data)/4))), [2, 1])
i18n_buff = PipeBuffer()
writedlm(i18n_buff, i18n_arr, ',')
@test i18n_arr == readcsv(i18n_buff)
Expand Down
2 changes: 1 addition & 1 deletion test/strings/basic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ foobaz(ch) = reinterpret(Char, typemax(UInt32))

@test "a".*["b","c"] == ["ab","ac"]
@test ["b","c"].*"a" == ["ba","ca"]
@test ["a","b"].*["c","d"]' == ["ac" "ad"; "bc" "bd"]
@test ["a","b"].*["c" "d"] == ["ac" "ad"; "bc" "bd"]

# Make sure NULL pointers are handled consistently by String
@test_throws ArgumentError unsafe_string(Ptr{UInt8}(0))
Expand Down

0 comments on commit dd55ba5

Please sign in to comment.