TestColorizeExplicitSyntax asserts that a specified syntax is used
(t *testing.T)
| 73 | |
| 74 | // TestColorizeExplicitSyntax asserts that a specified syntax is used |
| 75 | func 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 | } |