initial commits

master
Charles Iliya Krempeaux 2023-11-28 08:08:55 -08:00
parent d3a61fafef
commit f8e28ad6cd
2 changed files with 24 additions and 21 deletions

View File

@ -2,9 +2,12 @@ package eol
import ( import (
"io" "io"
"sourcecode.social/reiver/go-opt"
) )
func ReadLS(runescanner io.RuneScanner) (size int, err error) { func ReadLS(runescanner io.RuneScanner) (size int, err error) {
const runeNumber = 1 const characterNumber uint64 = 1
return readthisrune(runescanner, ls, runeNumber) var circumstance internalCircumstance = specifyCircumstance(opt.Something(LS), characterNumber)
return readthisrune(circumstance, runescanner, ls)
} }

View File

@ -67,103 +67,103 @@ func TestReadLS_fail(t *testing.T) {
}{ }{
{ {
Value: "", Value: "",
ExpectedError: `eol: problem reading character №1 of end-of-line sequence: EOF`, ExpectedError: `eol: problem reading character №1 of end-of-line sequence "\u2028": EOF`,
}, },
{ {
Value: "\n", Value: "\n",
ExpectedError: `eol: line-separator (LS) character (U+2028) not found for end-of-line character №1 — instead found '\n' (U+000A)`, ExpectedError: `eol: line-separator (LS) character (U+2028) not found for end-of-line sequence "\u2028" character №1 — instead found '\n' (U+000A)`,
}, },
{ {
Value: "\r", Value: "\r",
ExpectedError: `eol: line-separator (LS) character (U+2028) not found for end-of-line character №1 — instead found '\r' (U+000D)`, ExpectedError: `eol: line-separator (LS) character (U+2028) not found for end-of-line sequence "\u2028" character №1 — instead found '\r' (U+000D)`,
}, },
{ {
Value: "\u0085", Value: "\u0085",
ExpectedError: `eol: line-separator (LS) character (U+2028) not found for end-of-line character №1 — instead found '\u0085' (U+0085)`, ExpectedError: `eol: line-separator (LS) character (U+2028) not found for end-of-line sequence "\u2028" character №1 — instead found '\u0085' (U+0085)`,
}, },
{ {
Value: "😈", Value: "😈",
ExpectedError: `eol: line-separator (LS) character (U+2028) not found for end-of-line character №1 — instead found '😈' (U+1F608)`, ExpectedError: `eol: line-separator (LS) character (U+2028) not found for end-of-line sequence "\u2028" character №1 — instead found '😈' (U+1F608)`,
}, },
{ {
Value: "\napple banana cherry", Value: "\napple banana cherry",
ExpectedError: `eol: line-separator (LS) character (U+2028) not found for end-of-line character №1 — instead found '\n' (U+000A)`, ExpectedError: `eol: line-separator (LS) character (U+2028) not found for end-of-line sequence "\u2028" character №1 — instead found '\n' (U+000A)`,
}, },
{ {
Value: "\rapple banana cherry", Value: "\rapple banana cherry",
ExpectedError: `eol: line-separator (LS) character (U+2028) not found for end-of-line character №1 — instead found '\r' (U+000D)`, ExpectedError: `eol: line-separator (LS) character (U+2028) not found for end-of-line sequence "\u2028" character №1 — instead found '\r' (U+000D)`,
}, },
{ {
Value: "\u0085apple banana cherry", Value: "\u0085apple banana cherry",
ExpectedError: `eol: line-separator (LS) character (U+2028) not found for end-of-line character №1 — instead found '\u0085' (U+0085)`, ExpectedError: `eol: line-separator (LS) character (U+2028) not found for end-of-line sequence "\u2028" character №1 — instead found '\u0085' (U+0085)`,
}, },
{ {
Value: "😈apple banana cherry", Value: "😈apple banana cherry",
ExpectedError: `eol: line-separator (LS) character (U+2028) not found for end-of-line character №1 — instead found '😈' (U+1F608)`, ExpectedError: `eol: line-separator (LS) character (U+2028) not found for end-of-line sequence "\u2028" character №1 — instead found '😈' (U+1F608)`,
}, },
{ {
Value: " \n", Value: " \n",
ExpectedError: `eol: line-separator (LS) character (U+2028) not found for end-of-line character №1 — instead found ' ' (U+0020)`, ExpectedError: `eol: line-separator (LS) character (U+2028) not found for end-of-line sequence "\u2028" character №1 — instead found ' ' (U+0020)`,
}, },
{ {
Value: " \r", Value: " \r",
ExpectedError: `eol: line-separator (LS) character (U+2028) not found for end-of-line character №1 — instead found ' ' (U+0020)`, ExpectedError: `eol: line-separator (LS) character (U+2028) not found for end-of-line sequence "\u2028" character №1 — instead found ' ' (U+0020)`,
}, },
{ {
Value: " \u0085", Value: " \u0085",
ExpectedError: `eol: line-separator (LS) character (U+2028) not found for end-of-line character №1 — instead found ' ' (U+0020)`, ExpectedError: `eol: line-separator (LS) character (U+2028) not found for end-of-line sequence "\u2028" character №1 — instead found ' ' (U+0020)`,
}, },
{ {
Value: " \u2028", Value: " \u2028",
ExpectedError: `eol: line-separator (LS) character (U+2028) not found for end-of-line character №1 — instead found ' ' (U+0020)`, ExpectedError: `eol: line-separator (LS) character (U+2028) not found for end-of-line sequence "\u2028" character №1 — instead found ' ' (U+0020)`,
}, },
{ {
Value: " 😈", Value: " 😈",
ExpectedError: `eol: line-separator (LS) character (U+2028) not found for end-of-line character №1 — instead found ' ' (U+0020)`, ExpectedError: `eol: line-separator (LS) character (U+2028) not found for end-of-line sequence "\u2028" character №1 — instead found ' ' (U+0020)`,
}, },
{ {
Value: ".\n", Value: ".\n",
ExpectedError: `eol: line-separator (LS) character (U+2028) not found for end-of-line character №1 — instead found '.' (U+002E)`, ExpectedError: `eol: line-separator (LS) character (U+2028) not found for end-of-line sequence "\u2028" character №1 — instead found '.' (U+002E)`,
}, },
{ {
Value: ".\r", Value: ".\r",
ExpectedError: `eol: line-separator (LS) character (U+2028) not found for end-of-line character №1 — instead found '.' (U+002E)`, ExpectedError: `eol: line-separator (LS) character (U+2028) not found for end-of-line sequence "\u2028" character №1 — instead found '.' (U+002E)`,
}, },
{ {
Value: ".\u0085", Value: ".\u0085",
ExpectedError: `eol: line-separator (LS) character (U+2028) not found for end-of-line character №1 — instead found '.' (U+002E)`, ExpectedError: `eol: line-separator (LS) character (U+2028) not found for end-of-line sequence "\u2028" character №1 — instead found '.' (U+002E)`,
}, },
{ {
Value: ".\u2028", Value: ".\u2028",
ExpectedError: `eol: line-separator (LS) character (U+2028) not found for end-of-line character №1 — instead found '.' (U+002E)`, ExpectedError: `eol: line-separator (LS) character (U+2028) not found for end-of-line sequence "\u2028" character №1 — instead found '.' (U+002E)`,
}, },
{ {
Value: ".😈", Value: ".😈",
ExpectedError: `eol: line-separator (LS) character (U+2028) not found for end-of-line character №1 — instead found '.' (U+002E)`, ExpectedError: `eol: line-separator (LS) character (U+2028) not found for end-of-line sequence "\u2028" character №1 — instead found '.' (U+002E)`,
}, },
} }