Skip to content

Commit

Permalink
remove all pre 0.4 tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyhffong committed Nov 30, 2015
1 parent 632c120 commit 0fd60f1
Show file tree
Hide file tree
Showing 11 changed files with 61 additions and 155 deletions.
2 changes: 1 addition & 1 deletion REQUIRE
@@ -1,2 +1,2 @@
julia 0.4-
julia 0.4
Compat 0.7
42 changes: 13 additions & 29 deletions test/array.jl
@@ -1,25 +1,17 @@
if VERSION < v"0.4-"
@assert [[1,2],[3,4]] == [1,2,3,4]
s = """
r = [[1,2], [3,4]]
"""
msgs = lintstr( s )
@test( contains( msgs[1].message, "Nested vcat" ) )
elseif VERSION >= v"0.4.0-dev+3345"
@assert [[1;2];[3;4]] == [1;2;3;4]
s = """
r = [[1;2];[3;4]]
"""
msgs = lintstr( s )
@test( contains( msgs[1].message, "Nested vcat" ) )
@assert [[1;2];[3;4]] == [1;2;3;4]
s = """
r = [[1;2];[3;4]]
"""
msgs = lintstr( s )
@test( contains( msgs[1].message, "Nested vcat" ) )

s = """
r = [[1,2],[3,4]]
"""
msgs = lintstr( s )
println( msgs )
@test( contains( msgs[1].message, "Nested vect" ) )

s = """
r = [[1,2],[3,4]]
"""
msgs = lintstr( s )
println( msgs )
@test( contains( msgs[1].message, "Nested vect" ) )
end
@assert [[1 2] [3 4]] == [1 2 3 4]
s = """
r = [[1 2] [3 4]]
Expand Down Expand Up @@ -134,14 +126,6 @@ sndlast = s[end -1]
msgs = lintstr( s )
@test( contains( msgs[1].message, "Ambiguity of `[end -n]` as a matrix row vs index [end-n]" ) )

if VERSION < v"0.4-"
s = """
s = {}
"""
msgs = lintstr( s )
@test( contains( msgs[1].message, "may be deprecated in Julia 0.4" ) )
end

s = """
function f()
x1 = zeros(100, 100)
Expand Down
4 changes: 2 additions & 2 deletions test/basics.jl
@@ -1,4 +1,4 @@
p = "non_existing_1234_4321"
@test !ispath( p )
@test_throws( String, lintfile( p ) )
@test_throws( String, lintpkg( p ) )
@test_throws( AbstractString, lintfile( p ) )
@test_throws( AbstractString, lintpkg( p ) )
13 changes: 0 additions & 13 deletions test/comprehensions.jl
Expand Up @@ -3,19 +3,6 @@ s = """[i for i in 1:2]
msgs = lintstr( s )
@assert( isempty( msgs ) )

if VERSION < v"0.4-"
s = """{i for i in 1:2}
"""
msgs = lintstr( s )
@assert( contains( msgs[1].message, "deprecated by Julia 0.4" ) )

s = """
{ y1 => y1*y1 for y1 in 1:2 }
"""
msgs = lintstr( s )
@assert( contains( msgs[1].message, "deprecated by Julia 0.4" ) )
end

s = """
[j => j*j for j in 1:2 ]
"""
Expand Down
2 changes: 1 addition & 1 deletion test/deprecate.jl
Expand Up @@ -66,7 +66,7 @@ msgs = lintstr(s)
@assert( contains( msgs[1].message, "generic deprecate message" ) )

s = """
function testDep5{T <: String}( x::Array{T,1} )
function testDep5{T <: AbstractString}( x::Array{T,1} )
x
end
"""
Expand Down
14 changes: 0 additions & 14 deletions test/dictkey.jl
@@ -1,17 +1,3 @@
if VERSION < v"0.4-"
s = """
[ :a=>1, :b=>2, :a=>3]
"""
msgs = lintstr( s )
@test( contains( msgs[1].message, "may be deprecated by Julia 0.4" ) )

s = """
{ :a=>1, :b=>2, :a=>3}
"""
msgs = lintstr( s )
@test( contains( msgs[1].message, "may be deprecated by Julia 0.4" ) )
end

s = """@compat Dict(:a=>1, :b=>2, :a=>3 )"""
msgs = lintstr(s)
@test( contains( msgs[1].message, "Duplicate key" ) )
Expand Down
56 changes: 18 additions & 38 deletions test/funcall.jl
Expand Up @@ -230,25 +230,16 @@ end
"""
msgs = lintstr(s)
@test( contains( msgs[1].message, "typeof( x ) == Int" ) )
if VERSION < v"0.4-"
s = """
function f(x::Int8=int8(1))
@lintpragma( "Info type x")
return x
end
"""
msgs = lintstr(s)
@test( contains( msgs[1].message, "typeof( x ) == Int8" ) )
else
s = """
function f(x::Int8=Int8(1))
@lintpragma( "Info type x")
return x
end
"""
msgs = lintstr(s)
@test( contains( msgs[1].message, "typeof( x ) == Int8" ) )

s = """
function f(x::Int8=Int8(1))
@lintpragma( "Info type x")
return x
end
"""
msgs = lintstr(s)
@test( contains( msgs[1].message, "typeof( x ) == Int8" ) )

s = """
function f(c::Char)
x = convert( Int, c )
Expand All @@ -267,13 +258,8 @@ function f( args...; dict... )
end
"""
msgs = lintstr(s)
if VERSION < v"0.4.0-dev+4139"
@test contains( msgs[1].message, "typeof( args ) == (Any...,)")
@test contains( msgs[2].message, "typeof( dict ) == (Any...,)")
else
@test contains( msgs[1].message, "typeof( args ) == Tuple")
@test contains( msgs[2].message, "typeof( dict ) == Tuple")
end
@test contains( msgs[1].message, "typeof( args ) == Tuple")
@test contains( msgs[2].message, "typeof( dict ) == Tuple")

s = """
function f( args::Float64... )
Expand All @@ -282,11 +268,7 @@ function f( args::Float64... )
end
"""
msgs = lintstr(s)
if VERSION < v"0.4.0-dev+4139"
@test contains( msgs[1].message, "typeof( args ) == (Float64...,)")
else
@test contains( msgs[1].message, "typeof( args ) == Tuple{Vararg{Float64}}" )
end
@test contains( msgs[1].message, "typeof( args ) == Tuple{Vararg{Float64}}" )

s = """
function f( args::Float64... )
Expand Down Expand Up @@ -340,14 +322,12 @@ end
msgs = lintstr(s)
@test( isempty( msgs ) )

if VERSION >= v"0.4"
s = """
a = :b
f(; a => 1 )
"""
msgs = lintstr(s)
@test( isempty( msgs ) )
end
s = """
a = :b
f(; a => 1 )
"""
msgs = lintstr(s)
@test( isempty( msgs ) )

s="""
a = (:a, 1)
Expand Down
14 changes: 6 additions & 8 deletions test/ref.jl
Expand Up @@ -5,11 +5,9 @@ r[r]
msgs = lintstr( s )
@test( contains( msgs[1].message, "Value at position #1 is the referenced" ) )

if VERSION >= v"0.4-dev+3368"
s = """
r = [3,2,1]
r[1;r]
"""
msgs = lintstr( s )
@test( contains( msgs[1].message, "Value at position #2 is the referenced" ) )
end
s = """
r = [3,2,1]
r[1;r]
"""
msgs = lintstr( s )
@test( contains( msgs[1].message, "Value at position #2 is the referenced" ) )
4 changes: 1 addition & 3 deletions test/runtests.jl
Expand Up @@ -53,9 +53,7 @@ include( "unusedvar.jl")
include( "using.jl")
include( "versions.jl" )
include( "server.jl" )
if VERSION >= v"0.4.0-dev+1444"
include( "stagedfuncs.jl")
end
include( "stagedfuncs.jl")

println( "...OK\n")
include( "lintself.jl")
Expand Down
6 changes: 1 addition & 5 deletions test/symbol.jl
Expand Up @@ -3,11 +3,7 @@ s = Symbol( "abc" )
"""
msgs = lintstr( s )

if VERSION < v"0.4.0-dev+1830"
@test( contains( msgs[1].message, "symbol() instead of Symbol" ) )
else
@test isempty( msgs )
end
@test isempty( msgs )

s = """
if VERSION < v"0.4-"
Expand Down
59 changes: 18 additions & 41 deletions test/typecheck.jl
Expand Up @@ -7,43 +7,23 @@ end
msgs = lintstr( s )
@test( contains( msgs[1].message, "but assign a value of") )

if VERSION < v"0.4.0-dev+1830"
s = """
function f(c::Char)
x = int8(c)
x = int16(x)
x = int32(x)
x = int64(x)
x = int(x)
x = Rational(x)
x = float(x)
x = Complex(x)
@lintpragma( "Info type x")
return x
end
"""
msgs = lintstr(s)
@test( contains( msgs[1].message, "but now assigned" ) )
@test( contains( msgs[end].message, "typeof( x ) == Complex" ) )
else
s = """
function f(c::Char)
x = Int8(c)
x = Int16(x)
x = Int32(x)
x = Int64(x)
x = Int(x)
x = Rational(x)
x = float(x)
x = Complex(x)
@lintpragma( "Info type x")
return x
end
"""
msgs = lintstr(s)
@test( contains( msgs[1].message, "but now assigned" ) )
@test( contains( msgs[end].message, "typeof( x ) == Complex" ) )
s = """
function f(c::Char)
x = Int8(c)
x = Int16(x)
x = Int32(x)
x = Int64(x)
x = Int(x)
x = Rational(x)
x = float(x)
x = Complex(x)
@lintpragma( "Info type x")
return x
end
"""
msgs = lintstr(s)
@test( contains( msgs[1].message, "but now assigned" ) )
@test( contains( msgs[end].message, "typeof( x ) == Complex" ) )

s = """
function f()
Expand Down Expand Up @@ -195,11 +175,8 @@ function f()
end
"""
msgs = lintstr(s)
if VERSION < v"0.4.0-dev+4319"
@test( contains( msgs[1].message, "typeof( s ) == (Int64,Int64,Int64)" ) )
else
@test( contains( msgs[1].message, "typeof( s ) == Tuple{Int64,Int64,Int64}" ) )
end
@test( contains( msgs[1].message, "typeof( s ) == Tuple{Int64,Int64,Int64}" ) )

s = """
function f()
a = Complex{Float64}[]
Expand Down

0 comments on commit 0fd60f1

Please sign in to comment.