From 31e3a5744c1edbcb259816e1e959180c3a6a5116 Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Thu, 16 Oct 2014 15:55:18 -0400 Subject: [PATCH] Fix #12, julia 0.2 compatibility --- test/runtests.jl | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/test/runtests.jl b/test/runtests.jl index 73c699db90a5d..9bb9cda329584 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -30,18 +30,21 @@ td[1] = 1.0 @test @compat(Dict()) == Dict() @test @compat(Dict{Any,Any}()) == Dict{Any,Any}() -@test @compat(Dict([(1, 1)])) == Dict([(1, 1)]) +if VERSION >= v"0.3.0-" + @test @compat(Dict([(1, 1)])) == d +end -@test @compat(Dict(:a => Dict(:b => 1))) == Dict([(:a, Dict([(:b, 1)]))]) +d2 = Dict{Symbol,Dict{Symbol,Int}}() +d2[:a] = Dict{Symbol,Int}() +d2[:a][:b] = 1 +@test @compat(Dict(:a => Dict(:b => 1))) == d2 @compat function f() a = :a - b = :b - c = :c - d = :d - Dict(a => b, c => d) + b = Dict(:b => 1) + Dict(a => b) end -@test f() == Dict([(:a, :b), (:c, :d)]) +@test f() == d2 @test @compat split("a,b,,c", ',', limit=2) == ["a", "b,,c"] @test @compat split("a,b,,c", ',', limit=2,keep=true) == ["a", "b,,c"]