xgo
xgo copied to clipboard
Feature: convenient assert syntax
When writing asserts, could we just naturally do the actual check without repeating any name?
Current situation:
if result!="1234"{
t.Fatalf("expect result to be %s, actual: %s", "123", result)
}
If we can just write:
assert.Assert(result=="1234")
And xgo prints the variable name and actual value in a breaking down style upon failure:
xxx_test.go:12 result=="1234"
^
"123"
Besides, I think maybe we need to let user write AST plugins.
Look like a good idea. maybe xgo can be a all in one test suite?
Look like a good idea. maybe xgo can be a all in one test suite?
@WAY29 Thanks, groovy supports this assert feature, that's where the idea comes from. As for all in one, it could be completely possible if we can provide all features out of box that are required for writing tests.