Skip to content
This repository has been archived by the owner on Mar 6, 2020. It is now read-only.

gb test incorrectly passes flags to testing application #349

Closed
nsf opened this issue Sep 8, 2015 · 4 comments
Closed

gb test incorrectly passes flags to testing application #349

nsf opened this issue Sep 8, 2015 · 4 comments
Assignees
Labels

Comments

@nsf
Copy link

nsf commented Sep 8, 2015

Simple project:

[nsf @ case]$ tree src
src
└── projectx
    └── main_test.go

Contents of main_test.go:

package main

import (
    "flag"
    "testing"
)

var name = flag.String("name", "nsf", "what is your name")

func TestX(t *testing.T) {
    if *name != "jardin" {
        t.Fatalf("got: '%s', expected: 'jardin'", *name)
    }
}

Running gb test:

[nsf @ case]$ gb test -name=jardin
--- FAIL: TestX (0.00s)
        main_test.go:12: got: 'jardin=jardin', expected: 'jardin'
FAIL
FATAL command "test" failed: exit status 1

I'm using latest gb master as of now. 9c9026c

As you can see it passes flag as <value>=<value> instead of <value> for some reason.

@davecheney
Copy link
Contributor

Thank you for raising this issue. This is pretty broken at the moment, I plan to tackle it in the 0.2 milestone.

@davecheney
Copy link
Contributor

I thought that this was roughly fixed in 0.3.x, but it's not. Taking a look at this now.

@nsf
Copy link
Author

nsf commented Dec 6, 2015

Thanks.

@davecheney
Copy link
Contributor

You're welcome. Sorry it took me so long to get to this. Now I have a
proper end to end test of the gb command so it makes it easier to construct
test scenarios.

On Sun, Dec 6, 2015 at 12:52 PM, nsf notifications@github.com wrote:

Thanks.


Reply to this email directly or view it on GitHub
#349 (comment).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants