JuliaGizmos / Escher.jl

Composable Web UIs in Julia
https://juliagizmos.github.io/Escher.jl
Other
337 stars 63 forks source link

WIP: switch to Colors package (do not merge yet) #68

Closed timholy closed 9 years ago

timholy commented 9 years ago

Well, sadly I did not quite figure out how to get this to work:

julia> include("runtests.jl")
begin 
    immutable TestType2
        a::FloatingPoint
        b::Int
        x::Int
    end
    test2(#1320#a::FloatingPoint,#1321#b,#1322#x) = TestType2(#1320#a,#1321#b,#1322#x)
    test2(#1323#a::FloatingPoint,#1324#b) = (#1325#x->begin  # /home/tim/.julia/v0.3/Escher/src/basics/macros.jl, line 224:
                TestType2(#1323#a,#1324#b,#1325#x)
            end)
    Escher.escher_meta[test2] = $(Expr(:dict, :(:doc=>""), :(:name=>test2), :(:type=>:TestType2), :(:args=>[merge({:type=>:FloatingPoint,:curried=>false,:coerced=>false,:kwarg=>false,:name=>:a},$(Expr(:dict, :(:doc=>"")))),merge({:type=>:Int,:curried=>false,:coerced=>true,:kwarg=>false,:name=>:b},$(Expr(:dict, :(:doc=>"")))),merge({:type=>:Int,:curried=>true,:coerced=>true,:kwarg=>false,:name=>:x},$(Expr(:dict, :(:doc=>""))))])))
end
Test4{B}(Integer[],B(),2)
ERROR: FactCheck finished with 4 non-successful tests.
 in error at error.jl:21
 in exitstatus at /home/tim/.julia/v0.3/FactCheck/src/FactCheck.jl:500
 in include at ./boot.jl:245
 in include_from_node1 at ./loading.jl:128
while loading /home/tim/.julia/v0.3/Escher/test/runtests.jl, in expression starting on line 6

You can trigger it with test3(2.0, 3, 4). Any ideas?

Once this is working, you still shouldn't merge until "C-day" (hopefully Tuesday or Wednesday, if we resolve the problems in time).

shashi commented 9 years ago

Weird...

julia> include("test/runtests.jl")

julia> test3(2.0,3,4)==test3(2.0,3,4)
true

julia> test3(2.0,3,4)
TestType3(2.0,3,4,"black",1.0)

julia> test3(2.0,3,4)==TestType3(2.0,3,4,"black",1.0)
false

# Just to make sure they are both of the same type
julia> typeof(test3(2.0,3,4))==typeof(TestType3(2.0,3,4,"black",1.0))
true

I made a thing called comparefields which compares each field, and that fixes the tests https://github.com/shashi/Escher.jl/commit/e45845c9dd17ec27d5232045e3b6c5f888aa4d82.

Thanks for doing this! :)

timholy commented 9 years ago

Thanks! I'm definitely looking forward to https://github.com/JuliaLang/julia/pull/12544

shashi commented 9 years ago

How is that issue related here? Is that why FactCheck stopped showing exactly which tests failed? It could still show the expression that did if I understand correctly...

timholy commented 9 years ago

Since these functions are defined through macros, you (or at least, I) don't get good backtraces. Makes debugging harder. I still use macros a lot anyway, of course.

timholy commented 9 years ago

OK, merge away!

shashi commented 9 years ago

Awesome!