mirror of
https://github.com/tjboldt/ProDOS-Utilities.git
synced 2024-06-18 09:30:45 +00:00
Fix text to BASIC when line feed after token
This commit is contained in:
parent
6e6ddc3eac
commit
38528eb671
|
@ -200,7 +200,7 @@ func ConvertTextToBasic(text string) ([]byte, error) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if skipChars > 0 {
|
if skipChars > 0 && c != '\n' {
|
||||||
skipChars--
|
skipChars--
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,7 +25,7 @@ func TestConvertBasicToText(t *testing.T) {
|
||||||
t.Run(testname, func(t *testing.T) {
|
t.Run(testname, func(t *testing.T) {
|
||||||
text := ConvertBasicToText(tt.basic)
|
text := ConvertBasicToText(tt.basic)
|
||||||
if text != tt.want {
|
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) {
|
t.Run(testname, func(t *testing.T) {
|
||||||
basic, _ := ConvertTextToBasic(tt.basicText)
|
basic, _ := ConvertTextToBasic(tt.basicText)
|
||||||
if bytes.Compare(basic, tt.want) != 0 {
|
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)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user