Maybe @jxy is asking about how to test something which happens on compile time 
and therefor has no output when run but when compiled.

You could do it like this:
    
    
    # test bindsym order
    import macros
    
    template check(x, y) =
      doAssert(x.gettypeinst.lisprepr == y)
    
    var a = 0
    block:
      var a = "block"
      block:
        var a = true
        block:
          var a = 0.0
          macro m: untyped =
            let s = bindsym"a"
            check(s[0], "Sym(float64)")
            check(s[1], "Sym(bool)")
            check(s[2], "Sym(string)")
            check(s[3], "Sym(int)")
            result = newstmtlist()
          m()
    

Not sure if there is a better way though.

Reply via email to