Test whether tokens reference the same memory as runes
This commit is contained in:
parent
6b6e485aca
commit
6fabfd9fd0
@ -121,6 +121,12 @@ func TestParseString (test *testing.T) {
|
||||
logTokens(test, correctTokens)
|
||||
test.FailNow()
|
||||
}
|
||||
// TODO: ensure runeLayout slices in the tokens reference the same
|
||||
// memory as the complete runes slice
|
||||
test.Logf("changing first rune from %c to x", runes[0].run)
|
||||
runes[0].run = 'x'
|
||||
tokenRune := tokens[0].runes[0].run
|
||||
if tokenRune != 'x' {
|
||||
test.Fatalf (
|
||||
"tokens does not reference the same memory as runes after changing runes: %c, %c",
|
||||
runes[0].run, tokenRune)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user