Fix text to BASIC when line feed after token

This commit is contained in:
Terence Boldt 2022-12-27 17:20:28 -05:00
parent 6e6ddc3eac
commit 38528eb671
2 changed files with 3 additions and 3 deletions

View File

@ -200,7 +200,7 @@ func ConvertTextToBasic(text string) ([]byte, error) {
}
}
if skipChars > 0 {
if skipChars > 0 && c != '\n' {
skipChars--
continue
}

View File

@ -25,7 +25,7 @@ func TestConvertBasicToText(t *testing.T) {
t.Run(testname, func(t *testing.T) {
text := ConvertBasicToText(tt.basic)
if text != tt.want {
t.Errorf("\ngot '%#v'\nwant '%#v'\n", []byte(text), []byte(tt.want))
t.Errorf("%s\ngot '%#v'\nwant '%#v'\n", testname, []byte(text), []byte(tt.want))
}
})
}
@ -69,7 +69,7 @@ func TestConvertTextToBasic(t *testing.T) {
t.Run(testname, func(t *testing.T) {
basic, _ := ConvertTextToBasic(tt.basicText)
if bytes.Compare(basic, tt.want) != 0 {
t.Errorf("\ngot '%#v'\nwant '%#v'\n", basic, tt.want)
t.Errorf("%s\ngot '%#v'\nwant '%#v'\n", testname, basic, tt.want)
}
})
}