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

Function TestColorizeExplicitSyntax

internal/sheet/colorize_test.go:75–94  ·  view source on GitHub ↗

TestColorizeExplicitSyntax asserts that a specified syntax is used

(t *testing.T)

Source from the content-addressed store, hash-verified

73
74// TestColorizeExplicitSyntax asserts that a specified syntax is used
75func TestColorizeExplicitSyntax(t *testing.T) {
76
77 conf := config.Config{
78 Formatter: "terminal16m",
79 Style: "monokai",
80 }
81
82 // colorize as bash
83 bashSheet := Sheet{Text: "def hello():\n pass", Syntax: "bash"}
84 bashSheet.Colorize(conf)
85
86 // colorize as python
87 pySheet := Sheet{Text: "def hello():\n pass", Syntax: "python"}
88 pySheet.Colorize(conf)
89
90 // different lexers should produce different output for Python code
91 if bashSheet.Text == pySheet.Text {
92 t.Error("bash and python syntax produced identical output")
93 }
94}

Callers

nothing calls this directly

Calls 1

ColorizeMethod · 0.95

Tested by

no test coverage detected