@@ -27,30 +27,28 @@ func TestParseArgs(t *testing.T) {
2727 // Only pass t into top-level Convey calls
2828 Convey ("Init args arrays: withVoice & withOutVoice" , t , func () {
2929 withoutAll := []string {"aa" , "bb" , "cc" }
30- withAll := []string {"aa" , "bb" , "-v" , "-m" }
31-
32- withVoice := []string {"aa" , "bb" , "-v" }
33- withMore := []string {"aa" , "bb" , "-m" }
30+ withAll := []string {"-v" , "-m" , "-q" , "aa" , "bb" }
3431
3532 Convey ("Call parse func" , func () {
36- _ , ret1 , ret2 := parseArgs (withoutAll )
37- _ , ret3 , ret4 := parseArgs (withAll )
38-
39- _ , ret5 , ret6 := parseArgs (withVoice )
40- _ , ret7 , ret8 := parseArgs (withMore )
33+ words01 , ret01 , ret02 , ret03 := parseArgs (withoutAll )
34+ words11 , ret11 , ret12 , ret13 := parseArgs (withAll )
4135
4236 Convey ("result should be: true & false" , func () {
43- So (ret1 , ShouldEqual , false )
44- So (ret2 , ShouldEqual , false )
45-
46- So (ret3 , ShouldEqual , true )
47- So (ret4 , ShouldEqual , true )
48-
49- So (ret5 , ShouldEqual , true )
50- So (ret6 , ShouldEqual , false )
51-
52- So (ret7 , ShouldEqual , false )
53- So (ret8 , ShouldEqual , true )
37+ So (words01 , ShouldContain , "aa" )
38+ So (words01 , ShouldContain , "bb" )
39+ So (words01 , ShouldContain , "cc" )
40+ So (ret01 , ShouldEqual , false )
41+ So (ret02 , ShouldEqual , false )
42+ So (ret03 , ShouldEqual , false )
43+
44+ So (words11 , ShouldContain , "aa" )
45+ So (words11 , ShouldContain , "bb" )
46+ So (words11 , ShouldNotContain , "-v" )
47+ So (words11 , ShouldNotContain , "-m" )
48+ So (words11 , ShouldNotContain , "-q" )
49+ So (ret11 , ShouldEqual , true )
50+ So (ret12 , ShouldEqual , true )
51+ So (ret13 , ShouldEqual , true )
5452 })
5553 })
5654 })
0 commit comments