add a regression test for #82

The test case we had didn't have a realistic-looking module path with a
dot, so we hadn't noticed the bug with IndexByte.

Fix that. We verified that the new test fails if we undo the fix.
pull/91/head
Daniel Martí 4 years ago
parent d0e01478f0
commit aa9767b0d2

@ -1,22 +1,22 @@
garble build -ldflags='-X=main.unexportedVersion=v1.0.0 -X=test/main/imported.ExportedVar=replaced'
garble build -ldflags='-X=main.unexportedVersion=v1.0.0 -X=domain.test/main/imported.ExportedVar=replaced'
exec ./main
cmp stderr main.stderr
! binsubstr main$exe 'unexportedVersion'
[short] stop # no need to verify this with -short
exec go build -ldflags='-X=main.unexportedVersion=v1.0.0 -X=test/main/imported.ExportedVar=replaced'
exec go build -ldflags='-X=main.unexportedVersion=v1.0.0 -X=domain.test/main/imported.ExportedVar=replaced'
exec ./main
cmp stderr main.stderr
binsubstr main$exe 'unexportedVersion'
-- go.mod --
module test/main
module domain.test/main
-- main.go --
package main
import (
"test/main/imported"
"domain.test/main/imported"
)
var unexportedVersion = "unknown"

Loading…
Cancel
Save