You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
diff --git a/_tests/test.lua b/_tests/test.lua
index 6364aec..0ce8927 100644
--- a/_tests/test.lua
+++ b/_tests/test.lua
@@ -19,6 +19,8 @@ assert(not pcall(re.find, "aaa", "(aaaa"))
assert(re.find("aaaa", "(b|c)*") == nil)
a, b, s = re.find("abcd efgh ijk", "i([jk])")
assert(a == 11 and b == 12 and s == "j")
+a, b = re.find("m", "m")
+assert(a == 1 and b == 0)
And the traceback:
kellen@chewbacca:~/.GOPATH/src/github.com/yuin/gluare$ go test
testing _tests/test.lua
--- FAIL: TestGluaRe (0.00s)
gluare_test.go:24: runtime error: index out of range
goroutine 18 [running]:
github.com/yuin/gopher-lua.(*LState).PCall.func1(0xc4200a9040, 0x5f8c90, 0xc420063e40, 0x0, 0x0, 0x0)
/home/kellen/.GOPATH/src/github.com/yuin/gopher-lua/state.go:1631 +0x7a9
panic(0x5bbe60, 0x6cdbb0)
/usr/lib/go-1.8/src/runtime/panic.go:489 +0x2cf
github.com/yuin/gluare.reFind(0xc4200a9040, 0x1)
/home/kellen/.GOPATH/src/github.com/yuin/gluare/gluare.go:60 +0x59e
github.com/yuin/gopher-lua.callGFunction(0xc4200a9040, 0x0, 0xc4200d8901)
/home/kellen/.GOPATH/src/github.com/yuin/gopher-lua/vm.go:123 +0x40
github.com/yuin/gopher-lua.init.3.func26(0xc4200a9040, 0x7c180603, 0xc42012e000, 0x0)
/home/kellen/.GOPATH/src/github.com/yuin/gopher-lua/vm.go:699 +0x40a
github.com/yuin/gopher-lua.mainLoop(0xc4200a9040, 0xc42012e000)
/home/kellen/.GOPATH/src/github.com/yuin/gopher-lua/vm.go:31 +0xd2
github.com/yuin/gopher-lua.(*LState).callR(0xc4200a9040, 0x0, 0xffffffffffffffff, 0x0)
/home/kellen/.GOPATH/src/github.com/yuin/gopher-lua/state.go:876 +0x277
github.com/yuin/gopher-lua.(*LState).Call(0xc4200a9040, 0x0, 0xffffffffffffffff)
/home/kellen/.GOPATH/src/github.com/yuin/gopher-lua/state.go:1610 +0x48
github.com/yuin/gopher-lua.(*LState).PCall(0xc4200a9040, 0x0, 0xffffffffffffffff, 0x0, 0x6b85e0, 0xc420165000)
/home/kellen/.GOPATH/src/github.com/yuin/gopher-lua/state.go:1671 +0x116
github.com/yuin/gopher-lua.(*LState).DoFile(0xc4200a9040, 0x5ee248, 0x8, 0x5f8708, 0x2)
/home/kellen/.GOPATH/src/github.com/yuin/gopher-lua/auxlib.go:394 +0xd1
github.com/yuin/gluare.testScriptDir(0xc420090680, 0xc420063f88, 0x1, 0x1, 0x5ed91f, 0x6)
/home/kellen/.GOPATH/src/github.com/yuin/gluare/gluare_test.go:23 +0x2ea
github.com/yuin/gluare.TestGluaRe(0xc420090680)
/home/kellen/.GOPATH/src/github.com/yuin/gluare/gluare_test.go:31 +0x74
testing.tRunner(0xc420090680, 0x5f8710)
/usr/lib/go-1.8/src/testing/testing.go:657 +0x96
created by testing.(*T).Run
/usr/lib/go-1.8/src/testing/testing.go:697 +0x2ca
stack traceback:
[G]: in function 'find'
test.lua:22: in main chunk
[G]: ?
FAIL
exit status 1
FAIL github.com/yuin/gluare 0.004s
And an issue with match:
@@ -65,3 +67,5 @@ assert(re.match("hello world", "\\w+", 6) == "world")
assert(re.match("hello world", "\\w+", -5) == "world")
a, b = re.match("from=world", "(\\w+)=(\\w+)")
assert(a == "from" and b == "world")
+a, b, c = re.match("123ab123", "([0-9]+)([a-z]+)([0-9]+)|(bc)([0-9]+)")
+assert (a == "123" and b == "ab" and c == "123")
kellen@chewbacca:~/.GOPATH/src/github.com/yuin/gluare$ go test
testing _tests/test.lua
--- FAIL: TestGluaRe (0.00s)
gluare_test.go:24: runtime error: slice bounds out of range
goroutine 5 [running]:
github.com/yuin/gopher-lua.(*LState).PCall.func1(0xc42008b040, 0x5f8c90, 0xc420063e40, 0x0, 0x0, 0x0)
/home/kellen/.GOPATH/src/github.com/yuin/gopher-lua/state.go:1631 +0x7a9
panic(0x5bbe60, 0x6cdbc0)
/usr/lib/go-1.8/src/runtime/panic.go:489 +0x2cf
github.com/yuin/gluare.reMatch(0xc42008b040, 0x1)
/home/kellen/.GOPATH/src/github.com/yuin/gluare/gluare.go:260 +0x2e9
github.com/yuin/gopher-lua.callGFunction(0xc42008b040, 0x0, 0x1)
/home/kellen/.GOPATH/src/github.com/yuin/gopher-lua/vm.go:123 +0x40
github.com/yuin/gopher-lua.init.3.func26(0xc42008b040, 0x7c180803, 0xc42010a000, 0x0)
/home/kellen/.GOPATH/src/github.com/yuin/gopher-lua/vm.go:699 +0x40a
github.com/yuin/gopher-lua.mainLoop(0xc42008b040, 0xc42010a000)
/home/kellen/.GOPATH/src/github.com/yuin/gopher-lua/vm.go:31 +0xd2
github.com/yuin/gopher-lua.(*LState).callR(0xc42008b040, 0x0, 0xffffffffffffffff, 0x0)
/home/kellen/.GOPATH/src/github.com/yuin/gopher-lua/state.go:876 +0x277
github.com/yuin/gopher-lua.(*LState).Call(0xc42008b040, 0x0, 0xffffffffffffffff)
/home/kellen/.GOPATH/src/github.com/yuin/gopher-lua/state.go:1610 +0x48
github.com/yuin/gopher-lua.(*LState).PCall(0xc42008b040, 0x0, 0xffffffffffffffff, 0x0, 0x6b85e0, 0xc42013f800)
/home/kellen/.GOPATH/src/github.com/yuin/gopher-lua/state.go:1671 +0x116
github.com/yuin/gopher-lua.(*LState).DoFile(0xc42008b040, 0x5ee248, 0x8, 0x5f8708, 0x2)
/home/kellen/.GOPATH/src/github.com/yuin/gopher-lua/auxlib.go:394 +0xd1
github.com/yuin/gluare.testScriptDir(0xc42006cc30, 0xc420063f88, 0x1, 0x1, 0x5ed91f, 0x6)
/home/kellen/.GOPATH/src/github.com/yuin/gluare/gluare_test.go:23 +0x2ea
github.com/yuin/gluare.TestGluaRe(0xc42006cc30)
/home/kellen/.GOPATH/src/github.com/yuin/gluare/gluare_test.go:31 +0x74
testing.tRunner(0xc42006cc30, 0x5f8710)
/usr/lib/go-1.8/src/testing/testing.go:657 +0x96
created by testing.(*T).Run
/usr/lib/go-1.8/src/testing/testing.go:697 +0x2ca
stack traceback:
[G]: in function 'match'
test.lua:70: in main chunk
[G]: ?
FAIL
exit status 1
FAIL github.com/yuin/gluare 0.003s
The text was updated successfully, but these errors were encountered:
Kellel
changed the title
Many regexes cause golang tracebacks
Simple find regexes and some regex cause golang tracebacks
May 19, 2017
A simple find with a one letter match
And the traceback:
And an issue with match:
The text was updated successfully, but these errors were encountered: