From 719b7dddd5fc07af284de67f3438f456f3070cb9 Mon Sep 17 00:00:00 2001 From: Michael Eastwood Date: Mon, 5 Jan 2015 20:51:03 -0800 Subject: [PATCH 1/2] beginswith has been renamed to startswith (I think I got the Julia version right..) --- src/Compat.jl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Compat.jl b/src/Compat.jl index 3a2965c4f6c82..dd3df9cfb1330 100644 --- a/src/Compat.jl +++ b/src/Compat.jl @@ -134,6 +134,11 @@ if VERSION < v"0.4.0-dev+2056" end end +if VERSION < v"0.4.0-dev+2485" + startswith = Base.beginswith + export startswith +end + function _compat(ex::Expr) if ex.head == :call f = ex.args[1] From 3869c708e238d9139745471538b1ff09a6aa1d31 Mon Sep 17 00:00:00 2001 From: Michael Eastwood Date: Mon, 5 Jan 2015 20:57:02 -0800 Subject: [PATCH 2/2] Add a basic test for startswith --- test/runtests.jl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/runtests.jl b/test/runtests.jl index 0cc739479cf53..13895f9404c9d 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -71,3 +71,6 @@ end @test IPv4("1.2.3.4") == ip"1.2.3.4" @test IPv6("2001:1:2:3::1") == ip"2001:1:2:3::1" @test isless(ip"1.2.3.4", ip"1.2.3.5") + +@test startswith("abcdef","abc") == true +@test startswith("abcdef","def") == false