https://github.com/JuliaLang/julia
Revision f9f9cf317a294c138c5539960d7b6148d67acc95 authored by Keno Fischer on 15 September 2018, 19:13:09 UTC, committed by Keno Fischer on 18 September 2018, 23:17:40 UTC
1 parent 8c4d61e
Raw File
Tip revision: f9f9cf317a294c138c5539960d7b6148d67acc95 authored by Keno Fischer on 15 September 2018, 19:13:09 UTC
Add a method of run_passes that skips SSA conversion
Tip revision: f9f9cf3
cartesian.jl
# This file is a part of Julia. License is MIT: https://julialang.org/license

@test Base.Cartesian.exprresolve(:(1 + 3)) == 4
ex = Base.Cartesian.exprresolve(:(if 5 > 4; :x; else :y; end))
@test ex.args[2] == QuoteNode(:x)

@test Base.Cartesian.lreplace!("val_col", Base.Cartesian.LReplace{String}(:col, "col", 1)) == "val_1"

# test conversions for CartesianIndex

@testset "CartesianIndex Conversions" begin
    @test convert(Int, CartesianIndex(42)) === 42
    @test convert(Float64, CartesianIndex(42)) === 42.0
    @test convert(Tuple, CartesianIndex(42, 1)) === (42, 1)
    # can't convert higher-dimensional indices to Int
    @test_throws MethodError convert(Int, CartesianIndex(42, 1))
end
back to top