- 
                Notifications
    You must be signed in to change notification settings 
- Fork 36
Closed
Labels
Description
Lines 56 to 82 in 2252a9b
| # Test Base functions: | |
| # string, Symbol, ==, hash, in, keys, haskey, isempty, push!!, empty!!, | |
| # getindex, setindex!, getproperty, setproperty! | |
| csym = gensym() | |
| vn1 = @varname x[1][2] | |
| @test string(vn1) == "x[1][2]" | |
| @test Symbol(vn1) == Symbol("x[1][2]") | |
| vn2 = @varname x[1][2] | |
| @test vn2 == vn1 | |
| @test hash(vn2) == hash(vn1) | |
| @test inspace(vn1, (:x,)) | |
| # Tests for `inspace` | |
| space = (:x, :y, @varname(z[1]), @varname(M[1:10, :])) | |
| @test inspace(@varname(x), space) | |
| @test inspace(@varname(y), space) | |
| @test inspace(@varname(x[1]), space) | |
| @test inspace(@varname(z[1][1]), space) | |
| @test inspace(@varname(z[1][:]), space) | |
| @test inspace(@varname(z[1][2:3:10]), space) | |
| @test inspace(@varname(M[[2, 3], 1]), space) | |
| @test_throws ErrorException inspace(@varname(M[:, 1:4]), space) | |
| @test inspace(@varname(M[1, [2, 4, 6]]), space) | |
| @test !inspace(@varname(z[2]), space) | |
| @test !inspace(@varname(z), space) |