Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit65d83f2

Browse files
committed
fix test and case insensitivity
1 parent62ada21 commit65d83f2

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

‎cli/configssh.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ func (o *sshConfigOptions) addOption(option string) error {
7575
iferr!=nil {
7676
returnerr
7777
}
78-
ifo.removedKeys!=nil&&o.removedKeys[key] {
78+
ifo.removedKeys!=nil&&o.removedKeys[strings.ToLower(key)] {
7979
// Key marked as removed, skip.
8080
returnnil
8181
}
@@ -87,7 +87,7 @@ func (o *sshConfigOptions) addOption(option string) error {
8787
ifo.removedKeys==nil {
8888
o.removedKeys=make(map[string]bool)
8989
}
90-
o.removedKeys[key]=true
90+
o.removedKeys[strings.ToLower(key)]=true
9191
}
9292
returnnil
9393
}

‎cli/configssh_internal_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -272,32 +272,32 @@ func Test_sshConfigOptions_addOption(t *testing.T) {
272272
},
273273
},
274274
{
275-
Name:"Replace",
275+
Name:"AddTwo",
276276
Start: []string{
277277
"foo bar",
278278
},
279279
Add: []string{"Foo baz"},
280280
Expect: []string{
281+
"foo bar",
281282
"Foo baz",
282283
},
283284
},
284285
{
285-
Name:"AddAndReplace",
286+
Name:"AddAndRemove",
286287
Start: []string{
287-
"a b",
288288
"foo bar",
289289
"buzz bazz",
290290
},
291291
Add: []string{
292292
"b c",
293+
"a=",// Remove all entries that start with "a", i.e. next line.
293294
"A hello",
294295
"hello world",
295296
},
296297
Expect: []string{
297298
"foo bar",
298299
"buzz bazz",
299300
"b c",
300-
"A hello",
301301
"hello world",
302302
},
303303
},

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp