-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes golang#7260. Fix three broken tests in test.bash The test for issue 4568 was confused by go $ACTION . producing a package root of "", avoiding this mode fixes the test but weakens the test. The test for issue 4773 was broken on linux because math/Rand would fail to resolve as a package causing the test for duplicates to be skipped. Finally, the last breakage was a small change in the error message. Also, add test for foldDup. LGTM=iant R=iant, rsc CC=golang-codereviews https://golang.org/cl/61070044
- Loading branch information
1 parent
730f51a
commit 414b45d
Showing
2 changed files
with
40 additions
and
7 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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Copyright 2014 The Go Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style | ||
// license that can be found in the LICENSE file. | ||
|
||
package main | ||
|
||
import "testing" | ||
|
||
var foldDupTests = []struct { | ||
list []string | ||
f1, f2 string | ||
}{ | ||
{stringList("math/rand", "math/big"), "", ""}, | ||
{stringList("math", "strings"), "", ""}, | ||
{stringList("strings"), "", ""}, | ||
{stringList("strings", "strings"), "strings", "strings"}, | ||
{stringList("Rand", "rand", "math", "math/rand", "math/Rand"), "Rand", "rand"}, | ||
} | ||
|
||
func TestFoldDup(t *testing.T) { | ||
for _, tt := range foldDupTests { | ||
f1, f2 := foldDup(tt.list) | ||
if f1 != tt.f1 || f2 != tt.f2 { | ||
t.Errorf("foldDup(%q) = %q, %q, want %q, %q", tt.list, f1, f2, tt.f1, tt.f2) | ||
} | ||
} | ||
} |
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