Merge pull request #122 from GoASTScanner/testfixes

Correct bad test cases and intermitent failure
This commit is contained in:
Grant Murphy 2017-03-22 10:51:44 -07:00 committed by GitHub
commit 177fa7dde0
5 changed files with 6 additions and 11 deletions

View file

@ -15,6 +15,7 @@
package main
import (
"sort"
"strings"
"github.com/ryanuber/go-glob"
@ -41,6 +42,7 @@ func (f *fileList) String() string {
for p := range f.patterns {
ps = append(ps, p)
}
sort.Strings(ps)
return strings.Join(ps, ", ")
}

View file

@ -65,8 +65,8 @@ func Test_fileList_String(t *testing.T) {
},
{
name: "two patterns",
fields: fields{patterns: []string{"foo", "bar"}},
want: "foo, bar",
fields: fields{patterns: []string{"bar", "foo"}},
want: "bar, foo",
},
}
for _, tt := range tests {

View file

@ -22,6 +22,7 @@ package main
import (
_ "crypto/md5"
"fmt"
"os"
)
func main() {
for _, arg := range os.Args {

View file

@ -49,7 +49,7 @@ func TestNosecBlock(t *testing.T) {
`package main
import (
"os"
"os/exect"
"os/exec"
)
func main() {

View file

@ -89,8 +89,6 @@ func TestSQLInjectionFalsePositiveA(t *testing.T) {
package main
import (
"database/sql"
"fmt"
"os"
//_ "github.com/mattn/go-sqlite3"
)
@ -125,8 +123,6 @@ func TestSQLInjectionFalsePositiveB(t *testing.T) {
package main
import (
"database/sql"
"fmt"
"os"
//_ "github.com/mattn/go-sqlite3"
)
@ -161,8 +157,6 @@ func TestSQLInjectionFalsePositiveC(t *testing.T) {
package main
import (
"database/sql"
"fmt"
"os"
//_ "github.com/mattn/go-sqlite3"
)
@ -197,8 +191,6 @@ func TestSQLInjectionFalsePositiveD(t *testing.T) {
package main
import (
"database/sql"
"fmt"
"os"
//_ "github.com/mattn/go-sqlite3"
)