Closed zmousm closed 6 years ago
in jiq_test.go, like so:
jiq_test.go
=== RUN TestJqQueries --- PASS: TestJqQueries (0.02s) === RUN TestNewQuery --- PASS: TestNewQuery (0.00s) === RUN TestQueryGet --- PASS: TestQueryGet (0.00s) === RUN TestQuerySet --- PASS: TestQuerySet (0.00s) === RUN TestQueryAdd --- PASS: TestQueryAdd (0.00s) === RUN TestQueryClear --- PASS: TestQueryClear (0.00s) === RUN TestQueryDelete --- PASS: TestQueryDelete (0.00s) === RUN TestGetKeywords --- PASS: TestGetKeywords (0.00s) === RUN TestGetLastKeyword --- PASS: TestGetLastKeyword (0.00s) === RUN TestStringGetLastKeyword --- PASS: TestStringGetLastKeyword (0.00s) === RUN TestPopKeyword --- PASS: TestPopKeyword (0.00s) === RUN TestQueryStringGet --- PASS: TestQueryStringGet (0.00s) === RUN TestQueryStringSet --- PASS: TestQueryStringSet (0.00s) === RUN TestQueryStringAdd --- PASS: TestQueryStringAdd (0.00s) === RUN TestStringGetKeywords --- PASS: TestStringGetKeywords (0.00s) === RUN TestStringPopKeyword --- PASS: TestStringPopKeyword (0.00s) === RUN TestStringSplitLastKeyword --- PASS: TestStringSplitLastKeyword (0.00s) PASS ok github.com/fiatjaf/jiq 0.024s # github.com/fiatjaf/jiq/cmd/jiq src/github.com/fiatjaf/jiq/cmd/jiq/jiq_test.go:44:10: undefined: EngineMock src/github.com/fiatjaf/jiq/cmd/jiq/jiq_test.go:44:28: undefined: jiq.EngineResultInterface FAIL github.com/fiatjaf/jiq/cmd/jiq [build failed]
I guess this is a regression of 846f59244cc3d038ece157ed0e6d4427703d2479.
I did a quick fix like this but could not avoid re-adding EngineMock; I'm not doing a PR as I'm not sure about this approach.
EngineMock
--- a/cmd/jiq/jiq_test.go +++ b/cmd/jiq/jiq_test.go @@ -41,10 +41,12 @@ func TestjiqRunWithError(t *testing.T) { assert.Equal(0, called) } -func (e *EngineMock) Run() jiq.EngineResultInterface { +type EngineMock struct{ err error } + +func (e *EngineMock) Run() *jiq.EngineResult { return &jiq.EngineResult{ - err: fmt.Errorf(""), - qs: ".querystring", - content: `{"test": "result"}`, + Err: fmt.Errorf(""), + Qs: ".querystring", + Content: `{"test": "result"}`, } }
Oops, to my embarrassment I've frankly never run these tests after my modifications.
Your fix looks great. Please open a PR and I'll merge it.
in
jiq_test.go
, like so:I guess this is a regression of 846f59244cc3d038ece157ed0e6d4427703d2479.
I did a quick fix like this but could not avoid re-adding
EngineMock
; I'm not doing a PR as I'm not sure about this approach.