Skip to content

Commit 3585e74

Browse files
committed
Drop compat code for split and rsplit from #572
1 parent c713f96 commit 3585e74

File tree

4 files changed

+29
-40
lines changed

4 files changed

+29
-40
lines changed

README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,6 @@ Currently, the `@compat` macro supports the following syntaxes:
7575

7676
## Renaming
7777

78-
* `Compat.split` and `Compat.rsplit` accept `keepempty` keyword argument
79-
if `splitter` is given as second argument ([#26634])
80-
8178
* `realmin` and `realmax` are now `floatmin` and `floatmax` ([#28302])
8279

8380
* `squeeze` is now `dropdims` ([#28303], [#26660]).

src/Compat.jl

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -82,14 +82,6 @@ end
8282
end
8383
end
8484

85-
# https://github.com/JuliaLang/julia/pull/26647
86-
@static if VERSION < v"0.7.0-DEV.4724"
87-
rsplit(s::AbstractString, splitter; limit::Integer=0, keepempty::Bool=false) =
88-
Base.rsplit(s, splitter; limit=limit, keep=keepempty)
89-
split(s::AbstractString, splitter; limit::Integer=0, keepempty::Bool=false) =
90-
Base.split(s, splitter; limit=limit, keep=keepempty)
91-
end
92-
9385
# https://github.com/JuliaLang/julia/pull/27828
9486
if VERSION < v"0.7.0-beta.73"
9587
Base.mapslices(f, A::AbstractArray; dims=error("required keyword argument `dims` missing")) =

test/old.jl

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1220,3 +1220,32 @@ end
12201220
@test atan(1.0, 2.0) == atan(0.5)
12211221
@test atan(-1.0, -2.0) atan(0.5) - π
12221222
@test atan(big"-1.0", big"-2.0") atan(big"0.5") - π
1223+
1224+
# 0.7.0-DEV.4724
1225+
let
1226+
@test Compat.split("", ',' ; keepempty=false) == []
1227+
@test Compat.split(",", ',' ; keepempty=false) == []
1228+
@test Compat.split(",,", ','; keepempty=false) == []
1229+
@test Compat.rsplit("", ',' ; keepempty=false) == []
1230+
@test Compat.rsplit(",", ',' ; keepempty=false) == []
1231+
@test Compat.rsplit(",,", ','; keepempty=false) == []
1232+
1233+
str = "a.:.ba..:..cba.:.:.dcba.:."
1234+
@test Compat.split(str, ".:."; keepempty=false) == ["a","ba.",".cba",":.dcba"]
1235+
@test Compat.split(str, ".:."; keepempty=true) == ["a","ba.",".cba",":.dcba",""]
1236+
@test Compat.split(str, ".:."; limit=3, keepempty=false) == ["a","ba.",".cba.:.:.dcba.:."]
1237+
@test Compat.split(str, ".:."; limit=3, keepempty=true) == ["a","ba.",".cba.:.:.dcba.:."]
1238+
@test Compat.rsplit(str, ".:."; keepempty=false) == ["a","ba.",".cba.:","dcba"]
1239+
@test Compat.rsplit(str, ".:."; keepempty=true) == ["a","ba.",".cba.:","dcba",""]
1240+
@test Compat.rsplit(str, ".:."; limit=3, keepempty=false) == ["a.:.ba.",".cba.:","dcba"]
1241+
@test Compat.rsplit(str, ".:."; limit=3, keepempty=true) == ["a.:.ba..:..cba.:","dcba",""]
1242+
1243+
@test Compat.split(str, r"\.(:\.)+"; keepempty=false) == ["a","ba.",".cba","dcba"]
1244+
@test Compat.split(str, r"\.(:\.)+"; keepempty=true) == ["a","ba.",".cba","dcba",""]
1245+
@test Compat.split(str, r"\.(:\.)+"; limit=3, keepempty=false) == ["a","ba.",".cba.:.:.dcba.:."]
1246+
@test Compat.split(str, r"\.(:\.)+"; limit=3, keepempty=true) == ["a","ba.",".cba.:.:.dcba.:."]
1247+
@test Compat.split(str, r"\.+:\.+"; keepempty=false) == ["a","ba","cba",":.dcba"]
1248+
@test Compat.split(str, r"\.+:\.+"; keepempty=true) == ["a","ba","cba",":.dcba",""]
1249+
@test Compat.split(str, r"\.+:\.+"; limit=3, keepempty=false) == ["a","ba","cba.:.:.dcba.:."]
1250+
@test Compat.split(str, r"\.+:\.+"; limit=3, keepempty=true) == ["a","ba","cba.:.:.dcba.:."]
1251+
end

test/runtests.jl

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -85,35 +85,6 @@ end
8585
@test length(Compat.CartesianIndices((1:2,))) == 2
8686
@test length(Compat.CartesianIndices((1:2, -1:1))) == 6
8787

88-
# 0.7.0-DEV.4724
89-
let
90-
@test Compat.split("", ',' ; keepempty=false) == []
91-
@test Compat.split(",", ',' ; keepempty=false) == []
92-
@test Compat.split(",,", ','; keepempty=false) == []
93-
@test Compat.rsplit("", ',' ; keepempty=false) == []
94-
@test Compat.rsplit(",", ',' ; keepempty=false) == []
95-
@test Compat.rsplit(",,", ','; keepempty=false) == []
96-
97-
str = "a.:.ba..:..cba.:.:.dcba.:."
98-
@test Compat.split(str, ".:."; keepempty=false) == ["a","ba.",".cba",":.dcba"]
99-
@test Compat.split(str, ".:."; keepempty=true) == ["a","ba.",".cba",":.dcba",""]
100-
@test Compat.split(str, ".:."; limit=3, keepempty=false) == ["a","ba.",".cba.:.:.dcba.:."]
101-
@test Compat.split(str, ".:."; limit=3, keepempty=true) == ["a","ba.",".cba.:.:.dcba.:."]
102-
@test Compat.rsplit(str, ".:."; keepempty=false) == ["a","ba.",".cba.:","dcba"]
103-
@test Compat.rsplit(str, ".:."; keepempty=true) == ["a","ba.",".cba.:","dcba",""]
104-
@test Compat.rsplit(str, ".:."; limit=3, keepempty=false) == ["a.:.ba.",".cba.:","dcba"]
105-
@test Compat.rsplit(str, ".:."; limit=3, keepempty=true) == ["a.:.ba..:..cba.:","dcba",""]
106-
107-
@test Compat.split(str, r"\.(:\.)+"; keepempty=false) == ["a","ba.",".cba","dcba"]
108-
@test Compat.split(str, r"\.(:\.)+"; keepempty=true) == ["a","ba.",".cba","dcba",""]
109-
@test Compat.split(str, r"\.(:\.)+"; limit=3, keepempty=false) == ["a","ba.",".cba.:.:.dcba.:."]
110-
@test Compat.split(str, r"\.(:\.)+"; limit=3, keepempty=true) == ["a","ba.",".cba.:.:.dcba.:."]
111-
@test Compat.split(str, r"\.+:\.+"; keepempty=false) == ["a","ba","cba",":.dcba"]
112-
@test Compat.split(str, r"\.+:\.+"; keepempty=true) == ["a","ba","cba",":.dcba",""]
113-
@test Compat.split(str, r"\.+:\.+"; limit=3, keepempty=false) == ["a","ba","cba.:.:.dcba.:."]
114-
@test Compat.split(str, r"\.+:\.+"; limit=3, keepempty=true) == ["a","ba","cba.:.:.dcba.:."]
115-
end
116-
11788
let
11889
# test required keyword arguments
11990
@compat func1() = 1

0 commit comments

Comments
 (0)