MCPcopy
hub / github.com/direnv/direnv / TestBashEscape

Function TestBashEscape

internal/cmd/shell_test.go:7–13  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

5)
6
7func TestBashEscape(t *testing.T) {
8 assertEqual(t, `''`, BashEscape(""))
9 assertEqual(t, `$'escape\'quote'`, BashEscape("escape'quote"))
10 assertEqual(t, `$'foo\r\n\tbar'`, BashEscape("foo\r\n\tbar"))
11 assertEqual(t, `$'foo bar'`, BashEscape("foo bar"))
12 assertEqual(t, `$'\xc3\xa9'`, BashEscape("é"))
13}
14
15func TestShellDetection(t *testing.T) {
16 assertNotNil(t, DetectShell("-bash"))

Callers

nothing calls this directly

Calls 2

assertEqualFunction · 0.85
BashEscapeFunction · 0.85

Tested by

no test coverage detected