Package: golang-github-dataence-porter2 / 0.0~git20150829.56e4718-5

0001-porter2_test.go-Formally-port-from-surge-glog-to-gol.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
From: "Aaron M. Ucko" <ucko@debian.org>
Date: Tue, 24 Apr 2018 19:45:54 -0400
Subject: porter2_test.go: Formally port from surge/glog to golang/glog.

Replace Debugf, which golang/glog lacks, with Infof, which should be
close enough for this test's purposes.  (There's no Debian package for
surge/glog, and no point in bothering to make one for one private test.)
---
 porter2_test.go | 28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/porter2_test.go b/porter2_test.go
index d0d8df3..847f76f 100644
--- a/porter2_test.go
+++ b/porter2_test.go
@@ -23,7 +23,7 @@ import (
 	"testing"
 
 	"github.com/stretchr/testify/assert"
-	"github.com/surge/glog"
+	"github.com/golang/glog"
 )
 
 var (
@@ -324,7 +324,7 @@ var (
 func TestEnglishStep0(t *testing.T) {
 
 	for i, rs := range data0 {
-		//glog.Debugf("rs=%q, expected=%q", string(rs), string(expect[i]))
+		//glog.Infof("rs=%q, expected=%q", string(rs), string(expect[i]))
 		assert.Equal(t, step0(rs), expect0[i])
 	}
 }
@@ -333,7 +333,7 @@ func TestEnglishStep1a(t *testing.T) {
 
 	for i, rs := range data1a {
 		assert.Equal(t, step1a(rs), expect1a[i])
-		//glog.Debugf("rs=%q, expected=%q, got=%q", string(rs), string(expect1a[i]), string(s))
+		//glog.Infof("rs=%q, expected=%q, got=%q", string(rs), string(expect1a[i]), string(s))
 	}
 }
 
@@ -341,7 +341,7 @@ func TestEnglishStep1b(t *testing.T) {
 
 	for i, rs := range data1b {
 		r1, _ := markR1R2(rs)
-		//glog.Debugf("rs=%q, expected=%q, r1=%d", string(rs), string(expect1b[i]), r1)
+		//glog.Infof("rs=%q, expected=%q, r1=%d", string(rs), string(expect1b[i]), r1)
 		s := step1b(rs, r1)
 		assert.Equal(t, s, expect1b[i])
 	}
@@ -350,7 +350,7 @@ func TestEnglishStep1b(t *testing.T) {
 func TestEnglishStep1c(t *testing.T) {
 
 	for i, rs := range data1c {
-		//glog.Debugf("rs=%q, expected=%q, got=%q", string(rs), string(expect1c[i]), string(step1c(rs)))
+		//glog.Infof("rs=%q, expected=%q, got=%q", string(rs), string(expect1c[i]), string(step1c(rs)))
 		assert.Equal(t, step1c(rs), expect1c[i])
 	}
 }
@@ -360,7 +360,7 @@ func TestEnglishStep2(t *testing.T) {
 	for i, rs := range data2 {
 		r1, _ := markR1R2(rs)
 		s := step2(rs, r1)
-		//glog.Debugf("rs=%q, expected=%q, got=%q, r1=%d", string(rs), string(expect2[i]), string(s), r1)
+		//glog.Infof("rs=%q, expected=%q, got=%q, r1=%d", string(rs), string(expect2[i]), string(s), r1)
 		assert.Equal(t, s, expect2[i])
 	}
 }
@@ -370,7 +370,7 @@ func TestEnglishStep3(t *testing.T) {
 	for i, rs := range data3 {
 		r1, r2 := markR1R2(rs)
 		s := step3(rs, r1, r2)
-		//glog.Debugf("rs=%q, expected=%q, got=%q, r1=%d", string(rs), string(expect3[i]), string(s), r1)
+		//glog.Infof("rs=%q, expected=%q, got=%q, r1=%d", string(rs), string(expect3[i]), string(s), r1)
 		assert.Equal(t, s, expect3[i])
 	}
 }
@@ -380,7 +380,7 @@ func TestEnglishStep4(t *testing.T) {
 	for i, rs := range data4 {
 		_, r2 := markR1R2(rs)
 		s := step4(rs, r2)
-		//glog.Debugf("rs=%q, expected=%q, got=%q, r1=%d, r2=%d", string(rs), string(expect4[i]), string(s), r1, r2)
+		//glog.Infof("rs=%q, expected=%q, got=%q, r1=%d, r2=%d", string(rs), string(expect4[i]), string(s), r1, r2)
 		assert.Equal(t, s, expect4[i])
 	}
 }
@@ -390,7 +390,7 @@ func TestEnglishStep5(t *testing.T) {
 	for i, rs := range data5 {
 		r1, r2 := markR1R2(rs)
 		s := step5(rs, r1, r2)
-		//glog.Debugf("rs=%q, expected=%q, got=%q, r1=%d, r2=%d", string(rs), string(expect5[i]), string(s), r1, r2)
+		//glog.Infof("rs=%q, expected=%q, got=%q, r1=%d, r2=%d", string(rs), string(expect5[i]), string(s), r1, r2)
 		assert.Equal(t, s, expect5[i])
 	}
 }
@@ -398,7 +398,7 @@ func TestEnglishStep5(t *testing.T) {
 func TestEnglishMarkR1R2(t *testing.T) {
 	for i, rs := range dataRegions {
 		r1, r2 := markR1R2(rs)
-		//glog.Debugf("rs = %v, expected = %v, got = %v", rs, expectRegions[i], []int{r1, r2})
+		//glog.Infof("rs = %v, expected = %v, got = %v", rs, expectRegions[i], []int{r1, r2})
 		assert.Equal(t, expectRegions[i], []int{r1, r2})
 	}
 
@@ -408,7 +408,7 @@ func TestEnglishIsShortWord(t *testing.T) {
 	for s, v := range shortWords {
 		rs := []rune(s)
 		r1, _ := markR1R2(rs)
-		//glog.Debugf("rs=%q, r1=%d", s, r1)
+		//glog.Infof("rs=%q, r1=%d", s, r1)
 		assert.Equal(t, v, isShortWord(rs, r1))
 	}
 }
@@ -417,7 +417,7 @@ func TestEnglishExceptions1(t *testing.T) {
 
 	for k, v := range exceptions1 {
 		rs, ex := exception1([]rune(k))
-		//glog.Debugf("rs=%q, expected=%q, got=%q", k, v, string(rs))
+		//glog.Infof("rs=%q, expected=%q, got=%q", k, v, string(rs))
 		assert.True(t, ex)
 		assert.Equal(t, []rune(v), rs)
 	}
@@ -484,10 +484,10 @@ func TestEnglishVocOutput(t *testing.T) {
 
 		word := inscan.Text()
 		expect := outscan.Text()
-		//glog.Debugf("word=%q, expect=%q", word, expect)
+		//glog.Infof("word=%q, expect=%q", word, expect)
 		actual := Stem(word)
 		if actual != expect {
-			glog.Debugf("word=%q, actual=%q != expect=%q", word, actual, expect)
+			glog.Infof("word=%q, actual=%q != expect=%q", word, actual, expect)
 		}
 		assert.Equal(t, expect, actual)
 	}