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:
16
pkg/commands/os_test.go
Normal file
16
pkg/commands/os_test.go
Normal 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)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user