浏览代码

Fix tests and prepare for release

Jguer 6 年之前
父节点
当前提交
5bcadc58ac
共有 6 个文件被更改,包括 6 次插入68 次删除
  1. 1 1
      Makefile
  2. 1 1
      config.go
  3. 2 1
      config_test.go
  4. 2 2
      install.go
  5. 0 36
      print_test.go
  6. 0 27
      query_test.go

+ 1 - 1
Makefile

@@ -4,7 +4,7 @@ PREFIX := /usr
 DESTDIR :=
 
 MAJORVERSION := 8
-MINORVERSION ?= $(shell git rev-list --count master)
+MINORVERSION ?= 2
 PATCHVERSION := 0
 VERSION ?= ${MAJORVERSION}.${MINORVERSION}.${PATCHVERSION}
 

+ 1 - 1
config.go

@@ -78,7 +78,7 @@ type Configuration struct {
 	UseAsk             bool   `json:"useask"`
 }
 
-var version = "8.1173"
+var version = "8.2.0"
 
 // configFileName holds the name of the config file.
 const configFileName string = "config.json"

+ 2 - 1
config_test.go

@@ -14,7 +14,8 @@ func expect(t *testing.T, field string, a interface{}, b interface{}, err error)
 }
 
 func TestConfig(t *testing.T) {
-	config.PacmanConf = "testdata/pacman.conf"
+	config = &Configuration{}
+	config.PacmanConf = "./testdata/pacman.conf"
 
 	err := initAlpm()
 	if err != nil {

+ 2 - 2
install.go

@@ -434,9 +434,9 @@ nextpkg:
 
 	if len(incompatible) > 0 {
 		fmt.Println()
-		fmt.Print(bold(yellow(arrow))+" The following packages are not compatible with your architecture:")
+		fmt.Print(bold(yellow(arrow)) + " The following packages are not compatible with your architecture:")
 		for pkg := range incompatible {
-			fmt.Print("  "+cyan(basesMap[pkg].String()))
+			fmt.Print("  " + cyan(basesMap[pkg].String()))
 		}
 
 		fmt.Println()

+ 0 - 36
print_test.go

@@ -1,36 +0,0 @@
-package main
-
-import (
-	"os"
-	"testing"
-)
-
-func benchmarkPrintSearch(search string, b *testing.B) {
-	old := os.Stdout
-	_, w, _ := os.Pipe()
-	os.Stdout = w
-
-	for n := 0; n < b.N; n++ {
-		res, _ := queryRepo(append([]string{}, search))
-		res.printSearch()
-	}
-	os.Stdout = old
-}
-
-func BenchmarkPrintSearchSimpleTopDown(b *testing.B) {
-	config.SortMode = TopDown
-	benchmarkPrintSearch("chromium", b)
-}
-func BenchmarkPrintSearchComplexTopDown(b *testing.B) {
-	config.SortMode = TopDown
-	benchmarkPrintSearch("linux", b)
-}
-
-func BenchmarkPrintSearchSimpleBottomUp(b *testing.B) {
-	config.SortMode = BottomUp
-	benchmarkPrintSearch("chromium", b)
-}
-func BenchmarkPrintSearchComplexBottomUp(b *testing.B) {
-	config.SortMode = BottomUp
-	benchmarkPrintSearch("linux", b)
-}

+ 0 - 27
query_test.go

@@ -1,27 +0,0 @@
-package main
-
-import "testing"
-
-func benchmarkSearch(search string, b *testing.B) {
-	for n := 0; n < b.N; n++ {
-		queryRepo(append([]string{}, search))
-	}
-}
-func BenchmarkSearchSimpleTopDown(b *testing.B) {
-	config.SortMode = TopDown
-	benchmarkSearch("chromium", b)
-}
-
-func BenchmarkSearchSimpleBottomUp(b *testing.B) {
-	config.SortMode = BottomUp
-	benchmarkSearch("chromium", b)
-}
-
-func BenchmarkSearchComplexTopDown(b *testing.B) {
-	config.SortMode = TopDown
-	benchmarkSearch("linux", b)
-}
-func BenchmarkSearchComplexBottomUp(b *testing.B) {
-	config.SortMode = BottomUp
-	benchmarkSearch("linux", b)
-}