Skip to content

Commit

Permalink
Merge remote-tracking branch 'couchbase/unstable' into HEAD
Browse files Browse the repository at this point in the history
http: //ci-eventing.northscale.in/eventing-02.12.2021-03.23.pass.html
Change-Id: I3096fdc8f21401790aa2eda4c2211ab830f07a2f
  • Loading branch information
AnkitPrabhu committed Dec 2, 2021
2 parents 903f60a + 9fce322 commit 9088dbb
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
@@ -1,6 +1,6 @@
PROJECT (eventing)

SET(GOVERSION "1.13.7")
SET(GOVERSION "1.16.5")
SET (EVENTING_VER "evt-${PRODUCT_VERSION}-ee")

ADD_SUBDIRECTORY(gen)
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -4,7 +4,7 @@ top:=$(realpath ../../../../..)
workdir:=$(realpath .)/build
binaries:=eventing-producer eventing-consumer cbevent

goroot := $(shell find ~/.cbdepscache/exploded/x86_64 -type d -name 'go-1.13.7' -print -quit)/go
goroot := $(shell find ~/.cbdepscache/exploded/x86_64 -type d -name 'go-1.16.5' -print -quit)/go
ccache := $(shell which ccache)
cc_src := $(shell find features/ v8_consumer/ third_party/ gen/ ../eventing-ee/features/ -name '*.cc' -o -name '*.c')
go_src := $(shell find . ../eventing-ee/ -name '*.go')
Expand Down
23 changes: 21 additions & 2 deletions tests/functional_tests/parser_test.go
Expand Up @@ -4,6 +4,7 @@ package eventing

import (
"fmt"
"regexp"
"testing"

"github.com/couchbase/eventing/parser"
Expand Down Expand Up @@ -297,11 +298,29 @@ var script_data = []parserTestCase{
},
}

var esc_lt = regexp.MustCompile(
`\\u003C`)

var esc_gt = regexp.MustCompile(
`\\u003E`)

var esc_eq = regexp.MustCompile(
`\\u003D`)

func normalise(res string) string {
res = esc_lt.ReplaceAllString(res, `$1<`)
res = esc_gt.ReplaceAllString(res, `$1>`)
res = esc_eq.ReplaceAllString(res, `$1=`)
return res
}

func TestParserTransform(t *testing.T) {
for i := 0; i < len(snippet_inputs); i++ {
result, _ := parser.TranspileQueries(snippet_inputs[i], "")
if result != snippet_outputs[i] {
t.Errorf("Mismatch: %s\nExpected:\n%s\nGot:\n%s\n", Diff(snippet_outputs[i], result), snippet_outputs[i], result)
expectedOutput := snippet_outputs[i]
normalisedResult := normalise(result)
if normalisedResult != expectedOutput {
t.Errorf("Mismatch: %s\nExpected:\n%s\nGot:\n%s\n", Diff(expectedOutput, normalisedResult), expectedOutput, normalisedResult)
}
}
}
Expand Down

0 comments on commit 9088dbb

Please sign in to comment.