Well the trick is to use a template as follows, which lets you easily pass two 
values and it'll handle the comparison/write the values in a string. 
    
    
    import strformat
    template assertCompare(a, b: untyped) =
      assert a == b, "`a` was " & $a & " `b` was " & $b
    assertCompare(10, 11)
    
    
    Run

Reply via email to