errors: fix context generation with only one line

This commit is contained in:
Thomas Pelletier
2021-09-07 10:21:14 -04:00
committed by Thomas Pelletier
parent 7e2fa1bc80
commit 4a5ae9e81e
2 changed files with 17 additions and 1 deletions
+7
View File
@@ -148,6 +148,13 @@ line 5`,
6|
7| line 4`,
},
{
desc: "handle remainder of the error line when there is only one line",
doc: [3]string{`P=`, `[`, `#`},
msg: "array is incomplete",
expected: `1| P=[#
| ~ array is incomplete`,
},
}
for _, e := range examples {