Skip to content
Myr

Fix bind spec parser

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Junegunn Choi · committed by Junegunn Choi · parent 73162a4 · Browse files · 2 files+14 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+14 added−1 removed

  • other:+14 added−1 removed

2 files+14 added−1 removed

modified:src/options_test.go+9 added
497 unmodified lines
498 if len(err) == 0 {499 t.Errorf("Failed to detect error")500 }501}502503func TestMaskActionContents(t *testing.T) {504 original := ":execute((f)(o)(o)(b)(a)(r))+change-query@qu@ry@+up,x:reload:hello:world"505 expected := ":execute +change-query +up,x:reload "506 masked := maskActionContents(original)507 if masked != expected {508 t.Errorf("Not masked: %s", masked)509 }510}
modified:src/options.go+5 added-1 removed
936 unmodified lines
937 masked += action938 break939 }940 // Keep + or , at the end941 lastChar := action[loc[1]-1]942 if lastChar == '+' || lastChar == ',' {943 loc[1]--944 }941 masked += strings.Repeat(" ", loc[1]-1) + action[loc[1]-1:loc[1]]945 masked += strings.Repeat(" ", loc[1])946 action = action[loc[1]:]947 }948 masked = strings.Replace(masked, "::", string([]rune{escapedColon, ':'}), -1)949 masked = strings.Replace(masked, ",:", string([]rune{escapedComma, ':'}), -1)
1021 unmodified lines