Compare commits
16 Commits
Author | SHA1 | Date |
---|---|---|
Nick Dumas | 0d4101de26 | 6 months ago |
Nick Dumas | be0d629280 | 1 year ago |
Nick Dumas | 8b4ba717e2 | 1 year ago |
Nick Dumas | 3f3696eb9f | 1 year ago |
Nick Dumas | 17699a114c | 1 year ago |
Nick Dumas | 4235beff81 | 1 year ago |
Nick Dumas | 37dcdb9168 | 1 year ago |
Nick Dumas | ee6cad7662 | 1 year ago |
Nick Dumas | 82dd27bd06 | 1 year ago |
Nick Dumas | 04458800d1 | 1 year ago |
Nick Dumas | 25f949fafd | 1 year ago |
Nick Dumas | 0b377a0500 | 1 year ago |
Nick Dumas | ebeea16b0d | 1 year ago |
Nick Dumas | a8fe8282b3 | 1 year ago |
Nick Dumas | d5a48dd362 | 1 year ago |
Nick Dumas | 0c7b00e9b5 | 1 year ago |
@ -0,0 +1,17 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"log"
|
||||||
|
|
||||||
|
"go.uber.org/zap/zapcore"
|
||||||
|
|
||||||
|
"code.ndumas.com/ndumas/wikilink-parser"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
l := wikilink.Lex("debugLexer", `this is a [[wikilink]]`, zapcore.InfoLevel)
|
||||||
|
for _, item := range l.Items {
|
||||||
|
item := item
|
||||||
|
log.Printf("%#+v\n", item)
|
||||||
|
}
|
||||||
|
}
|
@ -1,31 +0,0 @@
|
|||||||
// Code generated by "stringer -type=ItemType"; DO NOT EDIT.
|
|
||||||
|
|
||||||
package wikilink
|
|
||||||
|
|
||||||
import "strconv"
|
|
||||||
|
|
||||||
func _() {
|
|
||||||
// An "invalid array index" compiler error signifies that the constant values have changed.
|
|
||||||
// Re-run the stringer command to generate them again.
|
|
||||||
var x [1]struct{}
|
|
||||||
_ = x[ItemError-0]
|
|
||||||
_ = x[ItemEOF-1]
|
|
||||||
_ = x[ItemIdent-2]
|
|
||||||
_ = x[ItemOpenLink-3]
|
|
||||||
_ = x[ItemCloseLink-4]
|
|
||||||
_ = x[ItemHeading-5]
|
|
||||||
_ = x[ItemBlockRef-6]
|
|
||||||
_ = x[ItemAlias-7]
|
|
||||||
_ = x[ItemText-8]
|
|
||||||
}
|
|
||||||
|
|
||||||
const _ItemType_name = "ItemErrorItemEOFItemIdentItemOpenLinkItemCloseLinkItemHeadingItemBlockRefItemAliasItemText"
|
|
||||||
|
|
||||||
var _ItemType_index = [...]uint8{0, 9, 16, 25, 37, 50, 61, 73, 82, 90}
|
|
||||||
|
|
||||||
func (i ItemType) String() string {
|
|
||||||
if i < 0 || i >= ItemType(len(_ItemType_index)-1) {
|
|
||||||
return "ItemType(" + strconv.FormatInt(int64(i), 10) + ")"
|
|
||||||
}
|
|
||||||
return _ItemType_name[_ItemType_index[i]:_ItemType_index[i+1]]
|
|
||||||
}
|
|
@ -0,0 +1,31 @@
|
|||||||
|
// Code generated by "stringer -type=LexemeType"; DO NOT EDIT.
|
||||||
|
|
||||||
|
package wikilink
|
||||||
|
|
||||||
|
import "strconv"
|
||||||
|
|
||||||
|
func _() {
|
||||||
|
// An "invalid array index" compiler error signifies that the constant values have changed.
|
||||||
|
// Re-run the stringer command to generate them again.
|
||||||
|
var x [1]struct{}
|
||||||
|
_ = x[LexError-0]
|
||||||
|
_ = x[LexEOF-1]
|
||||||
|
_ = x[LexIdent-2]
|
||||||
|
_ = x[LexOpenLink-3]
|
||||||
|
_ = x[LexCloseLink-4]
|
||||||
|
_ = x[LexHeading-5]
|
||||||
|
_ = x[LexBlockRef-6]
|
||||||
|
_ = x[LexAlias-7]
|
||||||
|
_ = x[LexText-8]
|
||||||
|
}
|
||||||
|
|
||||||
|
const _LexemeType_name = "LexErrorLexEOFLexIdentLexOpenLinkLexCloseLinkLexHeadingLexBlockRefLexAliasLexText"
|
||||||
|
|
||||||
|
var _LexemeType_index = [...]uint8{0, 8, 14, 22, 33, 45, 55, 66, 74, 81}
|
||||||
|
|
||||||
|
func (i LexemeType) String() string {
|
||||||
|
if i < 0 || i >= LexemeType(len(_LexemeType_index)-1) {
|
||||||
|
return "LexemeType(" + strconv.FormatInt(int64(i), 10) + ")"
|
||||||
|
}
|
||||||
|
return _LexemeType_name[_LexemeType_index[i]:_LexemeType_index[i+1]]
|
||||||
|
}
|
@ -1,275 +0,0 @@
|
|||||||
mkdir -p "/home/ndumas/work/wikilink-parser/reports"
|
|
||||||
mkdir -p "/home/ndumas/work/wikilink-parser/dist"
|
|
||||||
go clean code.ndumas.com/ndumas/wikilink-parser
|
|
||||||
rm -vrf "/home/ndumas/work/wikilink-parser/dist"/*
|
|
||||||
rm -vf "/home/ndumas/work/wikilink-parser/reports"/*
|
|
||||||
removed '/home/ndumas/work/wikilink-parser/reports/test.out'
|
|
||||||
go get -d -t code.ndumas.com/ndumas/wikilink-parser/...
|
|
||||||
go install golang.org/x/tools/cmd/stringer@latest
|
|
||||||
go generate
|
|
||||||
go test -race -v -tags "release" $(go list "code.ndumas.com/ndumas/wikilink-parser/..." | grep -v /vendor/) | tee "/home/ndumas/work/wikilink-parser/reports/test.out"
|
|
||||||
=== RUN Test_Lexer
|
|
||||||
=== RUN Test_Lexer/wikilink
|
|
||||||
2023/07/01 18:25:42 lexText
|
|
||||||
2023/07/01 18:25:42 lexOpenLink
|
|
||||||
{"level":"debug","logger":"lexer.emit","msg":"emitting item","pos":2,"width":0,"item":"ItemOpenLink:\"[[\""}
|
|
||||||
2023/07/01 18:25:42 lexIdent
|
|
||||||
{"level":"debug","logger":"lexer.emit","msg":"emitting item","pos":10,"width":1,"item":"ItemIdent:\"wikilink\""}
|
|
||||||
2023/07/01 18:25:42 lexCloseLink
|
|
||||||
{"level":"debug","logger":"lexer.emit","msg":"emitting item","pos":12,"width":1,"item":"ItemCloseLink:\"]]\""}
|
|
||||||
=== RUN Test_Lexer/wikilink|display_name
|
|
||||||
2023/07/01 18:25:42 lexText
|
|
||||||
{"level":"debug","logger":"lexer.emit","msg":"emitting item","pos":12,"width":0,"item":"ItemText:\"\""}
|
|
||||||
2023/07/01 18:25:42 lexText
|
|
||||||
2023/07/01 18:25:42 lexOpenLink
|
|
||||||
{"level":"debug","logger":"lexer.emit","msg":"emitting item","pos":2,"width":0,"item":"ItemOpenLink:\"[[\""}
|
|
||||||
2023/07/01 18:25:42 lexIdent
|
|
||||||
{"level":"debug","logger":"lexer.emit","msg":"emitting item","pos":10,"width":1,"item":"ItemIdent:\"wikilink\""}
|
|
||||||
2023/07/01 18:25:42 lexAlias
|
|
||||||
{"level":"debug","logger":"lexer.emit","msg":"emitting item","pos":11,"width":1,"item":"ItemAlias:\"|\""}
|
|
||||||
2023/07/01 18:25:42 lexIdent
|
|
||||||
{"level":"debug","logger":"lexer.emit","msg":"emitting item","pos":23,"width":1,"item":"ItemIdent:\"display name\""}
|
|
||||||
2023/07/01 18:25:42 lexCloseLink
|
|
||||||
{"level":"debug","logger":"lexer.emit","msg":"emitting item","pos":25,"width":1,"item":"ItemCloseLink:\"]]\""}
|
|
||||||
=== RUN Test_Lexer/wikilink|display_name|second_pipe
|
|
||||||
2023/07/01 18:25:42 lexText
|
|
||||||
2023/07/01 18:25:42 lexOpenLink
|
|
||||||
{"level":"debug","logger":"lexer.emit","msg":"emitting item","pos":2,"width":0,"item":"ItemOpenLink:\"[[\""}
|
|
||||||
2023/07/01 18:25:42 lexIdent
|
|
||||||
{"level":"debug","logger":"lexer.emit","msg":"emitting item","pos":10,"width":1,"item":"ItemIdent:\"wikilink\""}
|
|
||||||
2023/07/01 18:25:42 lexAlias
|
|
||||||
{"level":"debug","logger":"lexer.emit","msg":"emitting item","pos":11,"width":1,"item":"ItemAlias:\"|\""}
|
|
||||||
2023/07/01 18:25:42 lexIdent
|
|
||||||
{"level":"debug","logger":"lexer.emit","msg":"emitting item","pos":23,"width":1,"item":"ItemIdent:\"display name\""}
|
|
||||||
2023/07/01 18:25:42 lexText
|
|
||||||
{"level":"debug","logger":"lexer.emit","msg":"emitting item","pos":25,"width":0,"item":"ItemText:\"\""}
|
|
||||||
2023/07/01 18:25:42 lexAlias
|
|
||||||
{"level":"debug","logger":"lexer.emit","msg":"emitting item","pos":24,"width":1,"item":"ItemAlias:\"|\""}
|
|
||||||
2023/07/01 18:25:42 lexIdent
|
|
||||||
{"level":"debug","logger":"lexer.emit","msg":"emitting item","pos":35,"width":1,"item":"ItemIdent:\"second pipe\""}
|
|
||||||
2023/07/01 18:25:42 lexCloseLink
|
|
||||||
{"level":"debug","logger":"lexer.emit","msg":"emitting item","pos":37,"width":1,"item":"ItemCloseLink:\"]]\""}
|
|
||||||
=== RUN Test_Lexer/wikilink_with_numeric_alias|420|second_pipe
|
|
||||||
2023/07/01 18:25:42 lexText
|
|
||||||
2023/07/01 18:25:42 lexOpenLink
|
|
||||||
{"level":"debug","logger":"lexer.emit","msg":"emitting item","pos":2,"width":0,"item":"ItemOpenLink:\"[[\""}
|
|
||||||
2023/07/01 18:25:42 lexIdent
|
|
||||||
{"level":"debug","logger":"lexer.emit","msg":"emitting item","pos":10,"width":1,"item":"ItemIdent:\"wikilink\""}
|
|
||||||
2023/07/01 18:25:42 lexAlias
|
|
||||||
{"level":"debug","logger":"lexer.emit","msg":"emitting item","pos":11,"width":1,"item":"ItemAlias:\"|\""}
|
|
||||||
2023/07/01 18:25:42 lexIdent
|
|
||||||
{"level":"debug","logger":"lexer.emit","msg":"emitting item","pos":14,"width":1,"item":"ItemIdent:\"420\""}
|
|
||||||
2023/07/01 18:25:42 lexAlias
|
|
||||||
{"level":"debug","logger":"lexer.emit","msg":"emitting item","pos":15,"width":1,"item":"ItemAlias:\"|\""}
|
|
||||||
2023/07/01 18:25:42 lexIdent
|
|
||||||
{"level":"debug","logger":"lexer.emit","msg":"emitting item","pos":26,"width":1,"item":"ItemIdent:\"second pipe\""}
|
|
||||||
2023/07/01 18:25:42 lexCloseLink
|
|
||||||
{"level":"debug","logger":"lexer.emit","msg":"emitting item","pos":28,"width":1,"item":"ItemCloseLink:\"]]\""}
|
|
||||||
=== RUN Test_Lexer/wikilink_with_spaces_in_filename
|
|
||||||
2023/07/01 18:25:42 lexText
|
|
||||||
2023/07/01 18:25:42 lexOpenLink
|
|
||||||
{"level":"debug","logger":"lexer.emit","msg":"emitting item","pos":2,"width":0,"item":"ItemOpenLink:\"[[\""}
|
|
||||||
2023/07/01 18:25:42 lexIdent
|
|
||||||
{"level":"debug","logger":"lexer.emit","msg":"emitting item","pos":17,"width":1,"item":"ItemIdent:\"wikilink spaces\""}
|
|
||||||
2023/07/01 18:25:42 lexCloseLink
|
|
||||||
{"level":"debug","logger":"lexer.emit","msg":"emitting item","pos":19,"width":1,"item":"ItemCloseLink:\"]]\""}
|
|
||||||
=== RUN Test_Lexer/#heading
|
|
||||||
2023/07/01 18:25:42 lexText
|
|
||||||
2023/07/01 18:25:42 lexOpenLink
|
|
||||||
{"level":"debug","logger":"lexer.emit","msg":"emitting item","pos":2,"width":0,"item":"ItemOpenLink:\"[[\""}
|
|
||||||
2023/07/01 18:25:42 lexIdent
|
|
||||||
{"level":"debug","logger":"lexer.emit","msg":"emitting item","pos":10,"width":1,"item":"ItemIdent:\"#heading\""}
|
|
||||||
lexer_test.go:100: expected Type ItemHeading, received ItemIdent
|
|
||||||
lexer_test.go:105: expected Value "#", received "#heading"
|
|
||||||
2023/07/01 18:25:42 lexCloseLink
|
|
||||||
{"level":"debug","logger":"lexer.emit","msg":"emitting item","pos":12,"width":1,"item":"ItemCloseLink:\"]]\""}
|
|
||||||
lexer_test.go:100: expected Type ItemIdent, received ItemCloseLink
|
|
||||||
lexer_test.go:105: expected Value "heading", received "]]"
|
|
||||||
2023/07/01 18:25:42 lexText
|
|
||||||
{"level":"debug","logger":"lexer.emit","msg":"emitting item","pos":12,"width":0,"item":"ItemText:\"\""}
|
|
||||||
lexer_test.go:100: expected Type ItemCloseLink, received ItemText
|
|
||||||
lexer_test.go:105: expected Value "]]", received ""
|
|
||||||
=== RUN Test_Lexer/wikilink#heading
|
|
||||||
2023/07/01 18:25:42 lexText
|
|
||||||
{"level":"debug","logger":"lexer.emit","msg":"emitting item","pos":37,"width":0,"item":"ItemText:\"\""}
|
|
||||||
2023/07/01 18:25:42 lexText
|
|
||||||
{"level":"debug","logger":"lexer.emit","msg":"emitting item","pos":28,"width":0,"item":"ItemText:\"\""}
|
|
||||||
2023/07/01 18:25:42 lexText
|
|
||||||
{"level":"debug","logger":"lexer.emit","msg":"emitting item","pos":19,"width":0,"item":"ItemText:\"\""}
|
|
||||||
2023/07/01 18:25:42 lexText
|
|
||||||
{"level":"debug","logger":"lexer.emit","msg":"emitting item","pos":12,"width":0,"item":"ItemText:\"\""}
|
|
||||||
2023/07/01 18:25:42 lexText
|
|
||||||
2023/07/01 18:25:42 lexOpenLink
|
|
||||||
2023/07/01 18:25:42 lexText
|
|
||||||
{"level":"debug","logger":"lexer.emit","msg":"emitting item","pos":2,"width":0,"item":"ItemOpenLink:\"[[\""}
|
|
||||||
2023/07/01 18:25:42 lexIdent
|
|
||||||
{"level":"debug","logger":"lexer.emit","msg":"emitting item","pos":10,"width":1,"item":"ItemIdent:\"wikilink\""}
|
|
||||||
==================
|
|
||||||
WARNING: DATA RACE
|
|
||||||
Read at 0x00c0000822b0 by goroutine 21:
|
|
||||||
code.ndumas.com/ndumas/wikilink-parser.lexText()
|
|
||||||
/home/ndumas/work/wikilink-parser/states.go:82 +0x69
|
|
||||||
code.ndumas.com/ndumas/wikilink-parser.(*Lexer).run()
|
|
||||||
/home/ndumas/work/wikilink-parser/lexer.go:149 +0x3a
|
|
||||||
code.ndumas.com/ndumas/wikilink-parser.Lex.func1()
|
|
||||||
/home/ndumas/work/wikilink-parser/lexer.go:45 +0x39
|
|
||||||
|
|
||||||
Previous write at 0x00c0000822b0 by goroutine 20:
|
|
||||||
code.ndumas.com/ndumas/wikilink-parser.lexOpenLink()
|
|
||||||
/home/ndumas/work/wikilink-parser/states.go:96 +0x86
|
|
||||||
code.ndumas.com/ndumas/wikilink-parser.(*Lexer).NextItem()
|
|
||||||
/home/ndumas/work/wikilink-parser/lexer.go:64 +0xd5
|
|
||||||
code.ndumas.com/ndumas/wikilink-parser_test.Test_Lexer.func1()
|
|
||||||
/home/ndumas/work/wikilink-parser/lexer_test.go:98 +0x18c
|
|
||||||
testing.tRunner()
|
|
||||||
/usr/lib/golang/src/testing/testing.go:1446 +0x216
|
|
||||||
testing.(*T).Run.func1()
|
|
||||||
/usr/lib/golang/src/testing/testing.go:1493 +0x47
|
|
||||||
|
|
||||||
Goroutine 21 (running) created at:
|
|
||||||
code.ndumas.com/ndumas/wikilink-parser.Lex()
|
|
||||||
/home/ndumas/work/wikilink-parser/lexer.go:45 +0x41a
|
|
||||||
code.ndumas.com/ndumas/wikilink-parser_test.Test_Lexer.func1()
|
|
||||||
/home/ndumas/work/wikilink-parser/lexer_test.go:95 +0x69
|
|
||||||
testing.tRunner()
|
|
||||||
/usr/lib/golang/src/testing/testing.go:1446 +0x216
|
|
||||||
testing.(*T).Run.func1()
|
|
||||||
/usr/lib/golang/src/testing/testing.go:1493 +0x47
|
|
||||||
|
|
||||||
Goroutine 20 (running) created at:
|
|
||||||
testing.(*T).Run()
|
|
||||||
/usr/lib/golang/src/testing/testing.go:1493 +0x75d
|
|
||||||
code.ndumas.com/ndumas/wikilink-parser_test.Test_Lexer()
|
|
||||||
/home/ndumas/work/wikilink-parser/lexer_test.go:93 +0x1086
|
|
||||||
testing.tRunner()
|
|
||||||
/usr/lib/golang/src/testing/testing.go:1446 +0x216
|
|
||||||
testing.(*T).Run.func1()
|
|
||||||
/usr/lib/golang/src/testing/testing.go:1493 +0x47
|
|
||||||
==================
|
|
||||||
==================
|
|
||||||
WARNING: DATA RACE
|
|
||||||
Write at 0x00c0000822b8 by goroutine 21:
|
|
||||||
code.ndumas.com/ndumas/wikilink-parser.(*Lexer).next()
|
|
||||||
/home/ndumas/work/wikilink-parser/lexer.go:142 +0xe8
|
|
||||||
code.ndumas.com/ndumas/wikilink-parser.lexText()
|
|
||||||
/home/ndumas/work/wikilink-parser/states.go:85 +0xc4
|
|
||||||
code.ndumas.com/ndumas/wikilink-parser.(*Lexer).run()
|
|
||||||
/home/ndumas/work/wikilink-parser/lexer.go:149 +0x3a
|
|
||||||
code.ndumas.com/ndumas/wikilink-parser.Lex.func1()
|
|
||||||
/home/ndumas/work/wikilink-parser/lexer.go:45 +0x39
|
|
||||||
|
|
||||||
Previous write at 0x00c0000822b8 by goroutine 20:
|
|
||||||
code.ndumas.com/ndumas/wikilink-parser.(*Lexer).next()
|
|
||||||
/home/ndumas/work/wikilink-parser/lexer.go:142 +0xe8
|
|
||||||
code.ndumas.com/ndumas/wikilink-parser.lexIdent()
|
|
||||||
/home/ndumas/work/wikilink-parser/states.go:31 +0x64
|
|
||||||
code.ndumas.com/ndumas/wikilink-parser.(*Lexer).NextItem()
|
|
||||||
/home/ndumas/work/wikilink-parser/lexer.go:64 +0xd5
|
|
||||||
code.ndumas.com/ndumas/wikilink-parser_test.Test_Lexer.func1()
|
|
||||||
/home/ndumas/work/wikilink-parser/lexer_test.go:98 +0x18c
|
|
||||||
testing.tRunner()
|
|
||||||
/usr/lib/golang/src/testing/testing.go:1446 +0x216
|
|
||||||
testing.(*T).Run.func1()
|
|
||||||
/usr/lib/golang/src/testing/testing.go:1493 +0x47
|
|
||||||
|
|
||||||
Goroutine 21 (running) created at:
|
|
||||||
code.ndumas.com/ndumas/wikilink-parser.Lex()
|
|
||||||
/home/ndumas/work/wikilink-parser/lexer.go:45 +0x41a
|
|
||||||
code.ndumas.com/ndumas/wikilink-parser_test.Test_Lexer.func1()
|
|
||||||
/home/ndumas/work/wikilink-parser/lexer_test.go:95 +0x69
|
|
||||||
testing.tRunner()
|
|
||||||
/usr/lib/golang/src/testing/testing.go:1446 +0x216
|
|
||||||
testing.(*T).Run.func1()
|
|
||||||
/usr/lib/golang/src/testing/testing.go:1493 +0x47
|
|
||||||
|
|
||||||
Goroutine 20 (running) created at:
|
|
||||||
testing.(*T).Run()
|
|
||||||
/usr/lib/golang/src/testing/testing.go:1493 +0x75d
|
|
||||||
code.ndumas.com/ndumas/wikilink-parser_test.Test_Lexer()
|
|
||||||
/home/ndumas/work/wikilink-parser/lexer_test.go:93 +0x1086
|
|
||||||
testing.tRunner()
|
|
||||||
/usr/lib/golang/src/testing/testing.go:1446 +0x216
|
|
||||||
testing.(*T).Run.func1()
|
|
||||||
/usr/lib/golang/src/testing/testing.go:1493 +0x47
|
|
||||||
==================
|
|
||||||
==================
|
|
||||||
WARNING: DATA RACE
|
|
||||||
Read at 0x00c0000822a8 by goroutine 21:
|
|
||||||
code.ndumas.com/ndumas/wikilink-parser.(*Lexer).emit()
|
|
||||||
/home/ndumas/work/wikilink-parser/lexer.go:109 +0x64
|
|
||||||
code.ndumas.com/ndumas/wikilink-parser.lexText()
|
|
||||||
/home/ndumas/work/wikilink-parser/states.go:88 +0xf4
|
|
||||||
code.ndumas.com/ndumas/wikilink-parser.(*Lexer).run()
|
|
||||||
/home/ndumas/work/wikilink-parser/lexer.go:149 +0x3a
|
|
||||||
code.ndumas.com/ndumas/wikilink-parser.Lex.func1()
|
|
||||||
/home/ndumas/work/wikilink-parser/lexer.go:45 +0x39
|
|
||||||
|
|
||||||
Previous write at 0x00c0000822a8 by goroutine 20:
|
|
||||||
code.ndumas.com/ndumas/wikilink-parser.(*Lexer).emit()
|
|
||||||
/home/ndumas/work/wikilink-parser/lexer.go:119 +0x4cf
|
|
||||||
code.ndumas.com/ndumas/wikilink-parser.lexOpenLink()
|
|
||||||
/home/ndumas/work/wikilink-parser/states.go:97 +0xa4
|
|
||||||
code.ndumas.com/ndumas/wikilink-parser.(*Lexer).NextItem()
|
|
||||||
/home/ndumas/work/wikilink-parser/lexer.go:64 +0xd5
|
|
||||||
code.ndumas.com/ndumas/wikilink-parser_test.Test_Lexer.func1()
|
|
||||||
/home/ndumas/work/wikilink-parser/lexer_test.go:98 +0x18c
|
|
||||||
testing.tRunner()
|
|
||||||
/usr/lib/golang/src/testing/testing.go:1446 +0x216
|
|
||||||
testing.(*T).Run.func1()
|
|
||||||
/usr/lib/golang/src/testing/testing.go:1493 +0x47
|
|
||||||
|
|
||||||
Goroutine 21 (running) created at:
|
|
||||||
code.ndumas.com/ndumas/wikilink-parser.Lex()
|
|
||||||
/home/ndumas/work/wikilink-parser/lexer.go:45 +0x41a
|
|
||||||
code.ndumas.com/ndumas/wikilink-parser_test.Test_Lexer.func1()
|
|
||||||
/home/ndumas/work/wikilink-parser/lexer_test.go:95 +0x69
|
|
||||||
testing.tRunner()
|
|
||||||
/usr/lib/golang/src/testing/testing.go:1446 +0x216
|
|
||||||
testing.(*T).Run.func1()
|
|
||||||
/usr/lib/golang/src/testing/testing.go:1493 +0x47
|
|
||||||
|
|
||||||
Goroutine 20 (running) created at:
|
|
||||||
testing.(*T).Run()
|
|
||||||
/usr/lib/golang/src/testing/testing.go:1493 +0x75d
|
|
||||||
code.ndumas.com/ndumas/wikilink-parser_test.Test_Lexer()
|
|
||||||
/home/ndumas/work/wikilink-parser/lexer_test.go:93 +0x1086
|
|
||||||
testing.tRunner()
|
|
||||||
/usr/lib/golang/src/testing/testing.go:1446 +0x216
|
|
||||||
testing.(*T).Run.func1()
|
|
||||||
/usr/lib/golang/src/testing/testing.go:1493 +0x47
|
|
||||||
==================
|
|
||||||
2023/07/01 18:25:42 lexHeading
|
|
||||||
{"level":"debug","logger":"lexer.emit","msg":"emitting item","pos":20,"width":0,"item":"ItemText:\"wikilink#heading]]\""}
|
|
||||||
testing.go:1319: race detected during execution of test
|
|
||||||
--- FAIL: Test_Lexer (0.01s)
|
|
||||||
--- PASS: Test_Lexer/wikilink (0.00s)
|
|
||||||
--- PASS: Test_Lexer/wikilink|display_name (0.00s)
|
|
||||||
--- PASS: Test_Lexer/wikilink|display_name|second_pipe (0.00s)
|
|
||||||
--- PASS: Test_Lexer/wikilink_with_numeric_alias|420|second_pipe (0.00s)
|
|
||||||
--- PASS: Test_Lexer/wikilink_with_spaces_in_filename (0.00s)
|
|
||||||
--- FAIL: Test_Lexer/#heading (0.00s)
|
|
||||||
--- FAIL: Test_Lexer/wikilink#heading (0.00s)
|
|
||||||
panic: runtime error: slice bounds out of range [:21] with length 20 [recovered]
|
|
||||||
panic: runtime error: slice bounds out of range [:21] with length 20
|
|
||||||
|
|
||||||
goroutine 34 [running]:
|
|
||||||
testing.tRunner.func1.2({0x6e8160, 0xc0000e20a8})
|
|
||||||
/usr/lib/golang/src/testing/testing.go:1396 +0x372
|
|
||||||
testing.tRunner.func1()
|
|
||||||
/usr/lib/golang/src/testing/testing.go:1399 +0x5f0
|
|
||||||
panic({0x6e8160, 0xc0000e20a8})
|
|
||||||
/usr/lib/golang/src/runtime/panic.go:890 +0x262
|
|
||||||
code.ndumas.com/ndumas/wikilink-parser.(*Lexer).emit(0xc000082280, 0x5)
|
|
||||||
/home/ndumas/work/wikilink-parser/lexer.go:109 +0x506
|
|
||||||
code.ndumas.com/ndumas/wikilink-parser.lexHeading(0xc000082280)
|
|
||||||
/home/ndumas/work/wikilink-parser/states.go:58 +0xa5
|
|
||||||
code.ndumas.com/ndumas/wikilink-parser.(*Lexer).NextItem(0xc000082280)
|
|
||||||
/home/ndumas/work/wikilink-parser/lexer.go:64 +0xd6
|
|
||||||
code.ndumas.com/ndumas/wikilink-parser_test.Test_Lexer.func1(0xc000190b60)
|
|
||||||
/home/ndumas/work/wikilink-parser/lexer_test.go:98 +0x18d
|
|
||||||
testing.tRunner(0xc000190b60, 0xc00019cb40)
|
|
||||||
/usr/lib/golang/src/testing/testing.go:1446 +0x217
|
|
||||||
created by testing.(*T).Run
|
|
||||||
/usr/lib/golang/src/testing/testing.go:1493 +0x75e
|
|
||||||
FAIL code.ndumas.com/ndumas/wikilink-parser 0.024s
|
|
||||||
FAIL
|
|
Loading…
Reference in New Issue