1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-12-01 22:52:01 +02:00

#158: escapes backticks, which is a problem in shells like Bash

This commit is contained in:
Tommy Nguyen
2018-08-15 23:55:55 -04:00
parent 59ab38fff6
commit ee4660af97
2 changed files with 19 additions and 0 deletions

16
pkg/commands/os_test.go Normal file
View File

@@ -0,0 +1,16 @@
package commands
import "testing"
func TestQuote(t *testing.T) {
osCommand := &OSCommand {
Log: nil,
Platform: getPlatform(),
}
test := "hello `test`"
expected := osCommand.Platform.escapedQuote + "hello \\`test\\`" + osCommand.Platform.escapedQuote
test = osCommand.Quote(test)
if test != expected {
t.Error("Expected " + expected + ", got " + test)
}
}