-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from aiyengar2/update_wins_version
Update Go version, remove vendor, and misc. upgrades
- Loading branch information
Showing
1,221 changed files
with
1,198 additions
and
598,125 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
# IDE | ||
.idea/ | ||
.vscode/ | ||
|
||
# CMake | ||
cmake-build-debug/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
package flags | ||
|
||
import ( | ||
"fmt" | ||
"testing" | ||
) | ||
|
||
func TestNormal(t *testing.T) { | ||
val := listValue("RANCHER=hello WINS=world") | ||
valList, err := val.Get() | ||
if err != nil { | ||
t.Fatal(err) | ||
} | ||
// Check outputted values | ||
expectedList := []string{"RANCHER=hello", "WINS=world"} | ||
err = fmt.Errorf("Failed to parse list value: expected %v, got %v", expectedList, valList) | ||
for i, expected := range expectedList { | ||
if valList[i] != expected { | ||
t.Fatal(err) | ||
} | ||
} | ||
} | ||
|
||
func TestEscapedDoubleQuotes(t *testing.T) { | ||
val := listValue("NICK=bye LUTHER=\"hello\" RANCHER=\"hello world\" WINS=world") | ||
valList, err := val.Get() | ||
if err != nil { | ||
t.Fatal(err) | ||
} | ||
// Check outputted values | ||
expectedList := []string{"NICK=bye", "LUTHER=\"hello\"", "RANCHER=\"hello world\"", "WINS=world"} | ||
err = fmt.Errorf("Failed to parse list value: expected %v, got %v", expectedList, valList) | ||
for i, expected := range expectedList { | ||
if valList[i] != expected { | ||
t.Fatal(err) | ||
} | ||
} | ||
} | ||
|
||
func TestEscapedSingleQuotes(t *testing.T) { | ||
val := listValue("NICK=bye LUTHER='hello' RANCHER='hello world' WINS=world") | ||
valList, err := val.Get() | ||
if err != nil { | ||
t.Fatal(err) | ||
} | ||
// Check outputted values | ||
expectedList := []string{"NICK=bye", "LUTHER='hello'", "RANCHER='hello world'", "WINS=world"} | ||
err = fmt.Errorf("Failed to parse list value: expected %v, got %v", expectedList, valList) | ||
for i, expected := range expectedList { | ||
if valList[i] != expected { | ||
t.Fatal(err) | ||
} | ||
} | ||
} | ||
|
||
func TestEscapedSingleAndDoubleQuotes(t *testing.T) { | ||
val := listValue("NICK=bye LUTHER=\"hello\" RANCHER='hello world' WINS=world") | ||
valList, err := val.Get() | ||
if err != nil { | ||
t.Fatal(err) | ||
} | ||
// Check outputted values | ||
expectedList := []string{"NICK=bye", "LUTHER=\"hello\"", "RANCHER='hello world'", "WINS=world"} | ||
err = fmt.Errorf("Failed to parse list value: expected %v, got %v", expectedList, valList) | ||
for i, expected := range expectedList { | ||
if valList[i] != expected { | ||
t.Fatal(err) | ||
} | ||
} | ||
} | ||
|
||
func TestEscapedQuotesInQuotes(t *testing.T) { | ||
val := listValue("NICK=bye LUTHER=\"'hello'\" RANCHER='\"hello world\"' WINS=world") | ||
valList, err := val.Get() | ||
if err != nil { | ||
t.Fatal(err) | ||
} | ||
// Check outputted values | ||
expectedList := []string{"NICK=bye", "LUTHER=\"'hello'\"", "RANCHER='\"hello world\"'", "WINS=world"} | ||
err = fmt.Errorf("Failed to parse list value: expected %v, got %v", expectedList, valList) | ||
for i, expected := range expectedList { | ||
if valList[i] != expected { | ||
t.Fatal(err) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.