Skip to content

Commit dd55ba5

Browse files
committed
Remove (c)transpose no-op for Strings and revise associated tests.
1 parent 060a51c commit dd55ba5

File tree

3 files changed

+2
-4
lines changed

3 files changed

+2
-4
lines changed

base/strings/basic.jl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,6 @@ function length(s::AbstractString)
101101
end
102102
end
103103

104-
transpose(s::AbstractString) = s
105-
106104
## string comparison functions ##
107105

108106
function cmp(a::AbstractString, b::AbstractString)

test/datafmt.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ let i18n_data = ["Origin (English)", "Name (English)", "Origin (Native)", "Name
210210
"Yugoslavia (Cyrillic)", "Djordje Balasevic", "Југославија", "Ђорђе Балашевић",
211211
"Yugoslavia (Latin)", "Djordje Balasevic", "Jugoslavija", "Đorđe Balašević"]
212212

213-
i18n_arr = transpose(reshape(i18n_data, 4, Int(floor(length(i18n_data)/4))))
213+
i18n_arr = permutedims(reshape(i18n_data, 4, Int(floor(length(i18n_data)/4))), [2, 1])
214214
i18n_buff = PipeBuffer()
215215
writedlm(i18n_buff, i18n_arr, ',')
216216
@test i18n_arr == readcsv(i18n_buff)

test/strings/basic.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ foobaz(ch) = reinterpret(Char, typemax(UInt32))
464464

465465
@test "a".*["b","c"] == ["ab","ac"]
466466
@test ["b","c"].*"a" == ["ba","ca"]
467-
@test ["a","b"].*["c","d"]' == ["ac" "ad"; "bc" "bd"]
467+
@test ["a","b"].*["c" "d"] == ["ac" "ad"; "bc" "bd"]
468468

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

0 commit comments

Comments
 (0)