Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lem.Run output question #1

Open
yerden opened this issue Jul 4, 2022 · 0 comments
Open

lem.Run output question #1

yerden opened this issue Jul 4, 2022 · 0 comments

Comments

@yerden
Copy link

yerden commented Jul 4, 2022

Hello,

Here's an example (of meaningless) code:

package main

import (
	"bytes"
	"testing"

	"github.com/akutz/lem"
)

func copyWithBuffer(data []byte) []byte {
	//b := &bytes.Buffer{} // lem.World.m=&bytes.Buffer{} does not escape
	b := &bytes.Buffer{} // lem.World.m=does not escape
	b.Write(data)
	return b.Bytes()
}

func TestLem(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?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant