MCPcopy Index your code
hub / github.com/cheat/cheat / TestParseWindowsLineEndings

Function TestParseWindowsLineEndings

internal/sheet/parse_extended_test.go:8–29  ·  view source on GitHub ↗

TestParseWindowsLineEndings tests parsing with Windows line endings

(t *testing.T)

Source from the content-addressed store, hash-verified

6
7// TestParseWindowsLineEndings tests parsing with Windows line endings
8func TestParseWindowsLineEndings(t *testing.T) {
9 // stub our cheatsheet content with Windows line endings
10 markdown := "---\r\nsyntax: go\r\ntags: [ test ]\r\n---\r\nTo foo the bar: baz"
11
12 // parse the frontmatter
13 fm, text, err := parse(markdown)
14
15 // assert expectations
16 if err != nil {
17 t.Errorf("failed to parse markdown: %v", err)
18 }
19
20 want := "To foo the bar: baz"
21 if text != want {
22 t.Errorf("failed to parse text: want: %s, got: %s", want, text)
23 }
24
25 want = "go"
26 if fm.Syntax != want {
27 t.Errorf("failed to parse syntax: want: %s, got: %s", want, fm.Syntax)
28 }
29}

Callers

nothing calls this directly

Calls 1

parseFunction · 0.85

Tested by

no test coverage detected