You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
package main
import (
"bytes""testing""github.com/akutz/lem"
)
funccopyWithBuffer(data []byte) []byte {
//b := &bytes.Buffer{} // lem.World.m=&bytes.Buffer{} does not escapeb:=&bytes.Buffer{} // lem.World.m=does not escapeb.Write(data)
returnb.Bytes()
}
funcTestLem(t*testing.T) {
lem.Run(t)
}
Output:
--- FAIL: TestLem (0.26s)
--- FAIL: TestLem/World (0.00s)
tree.go:148: error: build optimization
reason: not found
regexp: (?m)^.*lem_test.go:12:\d+: does not escape$
source: b.Write(data)
FAIL
exit status 1
FAIL lem_test 0.265s
Could you please explain the meaning of each output line? My guess is:
reason is the cause of the test failure. Any other reasons possible?
regexp was used to match the specified m. Is it possible to match not the exact line (as in commented out line 11) but a part of it, like .*does not escape.*. EDIT: sorry, I just checked, it is indeed possible :)
source is the source code reference? why does it reference the next line then?
The text was updated successfully, but these errors were encountered:
Hello,
Here's an example (of meaningless) code:
Output:
Could you please explain the meaning of each output line? My guess is:
reason
is the cause of the test failure. Any other reasons possible?regexp
was used to match the specifiedm
. Is it possible to match not the exact line (as in commented out line 11) but a part of it, like.*does not escape.*
. EDIT: sorry, I just checked, it is indeed possible :)source
is the source code reference? why does it reference the next line then?The text was updated successfully, but these errors were encountered: