mirror of
https://github.com/cheat/cheat.git
synced 2026-03-07 11:13:33 +01:00
Remove integration tests in config_extended_test.go that duplicate unit tests in config_test.go for findLocalCheatpath. Remove redundant fuzz functions (FuzzFindLocalCheatpathNearestWins, FuzzTagsStress), a duplicate parse test (TestParseInvalidYAML), and a permanently-skipped interactive test (TestPromptIntegration). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
30 lines
687 B
Go
30 lines
687 B
Go
package sheet
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
// TestParseWindowsLineEndings tests parsing with Windows line endings
|
|
func TestParseWindowsLineEndings(t *testing.T) {
|
|
// stub our cheatsheet content with Windows line endings
|
|
markdown := "---\r\nsyntax: go\r\ntags: [ test ]\r\n---\r\nTo foo the bar: baz"
|
|
|
|
// parse the frontmatter
|
|
fm, text, err := parse(markdown)
|
|
|
|
// assert expectations
|
|
if err != nil {
|
|
t.Errorf("failed to parse markdown: %v", err)
|
|
}
|
|
|
|
want := "To foo the bar: baz"
|
|
if text != want {
|
|
t.Errorf("failed to parse text: want: %s, got: %s", want, text)
|
|
}
|
|
|
|
want = "go"
|
|
if fm.Syntax != want {
|
|
t.Errorf("failed to parse syntax: want: %s, got: %s", want, fm.Syntax)
|
|
}
|
|
}
|