Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1852)

Unified Diff: common/flag/stringlistflag/stringlistflag_test.go

Issue 2107283002: kitchen: add -python-path (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/luci-go@master
Patch Set: rebased Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « common/flag/stringlistflag/stringlistflag.go ('k') | common/flag/stringsetflag/stringsetflag_test.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: common/flag/stringlistflag/stringlistflag_test.go
diff --git a/common/flag/stringsetflag/stringsetflag_test.go b/common/flag/stringlistflag/stringlistflag_test.go
similarity index 56%
copy from common/flag/stringsetflag/stringsetflag_test.go
copy to common/flag/stringlistflag/stringlistflag_test.go
index c14fe585b0338af03e6e48889838c517a36dca91..c28d759ebddfa4c0f268643bcf55cb0f4925d7bd 100644
--- a/common/flag/stringsetflag/stringsetflag_test.go
+++ b/common/flag/stringlistflag/stringlistflag_test.go
@@ -2,7 +2,7 @@
// Use of this source code is governed under the Apache License, Version 2.0
// that can be found in the LICENSE file.
-package stringsetflag
+package stringlistflag
import (
"flag"
@@ -10,28 +10,22 @@ import (
"os"
)
-// Example demonstrates how to use flagenum to create bindings for a custom
-// type.
+// Example demonstrates how to use stringlistflag.
func Example() {
- sset := Flag{}
+ list := Flag{}
fs := flag.NewFlagSet("test", flag.ContinueOnError)
- fs.Var(&sset, "color", "favorite color, may be repeated.")
+ fs.Var(&list, "color", "favorite color, may be repeated.")
fs.SetOutput(os.Stdout)
fs.PrintDefaults()
// Flag parsing.
fs.Parse([]string{"-color", "Violet", "-color", "Red", "-color", "Violet"})
- fmt.Printf("Value is: %s\n", sset)
-
- fmt.Println("Likes Blue:", sset.Data.Has("Blue"))
- fmt.Println("Likes Red:", sset.Data.Has("Red"))
+ fmt.Printf("Value is: %s\n", list)
// Output:
// -color value
// favorite color, may be repeated.
- // Value is: Red,Violet
- // Likes Blue: false
- // Likes Red: true
+ // Value is: Violet, Red, Violet
}
« no previous file with comments | « common/flag/stringlistflag/stringlistflag.go ('k') | common/flag/stringsetflag/stringsetflag_test.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698