initial commits

master
Charles Iliya Krempeaux 2023-11-27 11:20:41 -08:00
parent e44c899fa3
commit a418be929b
3 changed files with 16 additions and 16 deletions

View File

@ -3,7 +3,7 @@ package eol
const (
lf = '\u000A'
cr = '\u000D'
nl = '\u0085'
nel = '\u0085'
ls = '\u2028'
)
@ -11,6 +11,6 @@ const (
LF = string(lf)
CR = string(cr)
CRLF = CR+LF
NL = string(nl)
NEL = string(nel)
LS = string(ls)
)

View File

@ -11,7 +11,7 @@ import (
// line-feed (LF) (U+000A) ('\n')
// carriage-return (CR) (U+000D) ('\r')
// carriage-return, line-feed ("\r\n")
// new-line (NL) (U+0085)
// next-line (NEL) (U+0085)
// line-separator (LS) (U+2028)
//
// If successful, ReadEOL return the end-of-line sequence and the number-of-bytes read.
@ -37,8 +37,8 @@ func ReadEOL(runescanner io.RuneScanner) (endofline string, size int, err error)
return LF, size0, nil
case cr:
// Nothing here.
case nl:
return NL, size0, nil
case nel:
return NEL, size0, nil
case ls:
return LS, size0, nil
default:

View File

@ -35,7 +35,7 @@ func TestReadEOL(t *testing.T) {
},
{
Value: "\u0085",
ExpectedEOL: eol.NL,
ExpectedEOL: eol.NEL,
ExpectedSize: 2,
},
{
@ -63,7 +63,7 @@ func TestReadEOL(t *testing.T) {
},
{
Value: "\u0085apple banana cherr",
ExpectedEOL: eol.NL,
ExpectedEOL: eol.NEL,
ExpectedSize: 2,
},
{