lucy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@apache.org
Subject [2/6] lucy git commit: Start new Go test file for Analysis.
Date Thu, 15 Oct 2015 21:43:01 GMT
Start new Go test file for Analysis.

Create test_analysis.go.  Move a test.


Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/64156f43
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/64156f43
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/64156f43

Branch: refs/heads/master
Commit: 64156f43bc9b47c7e9cde954c34de5a9849a951b
Parents: a347c81
Author: Marvin Humphrey <marvin@rectangular.com>
Authored: Tue Oct 6 12:55:28 2015 -0700
Committer: Marvin Humphrey <marvin@rectangular.com>
Committed: Tue Oct 6 18:44:16 2015 -0700

----------------------------------------------------------------------
 go/lucy/analysis_test.go | 29 +++++++++++++++++++++++++++++
 go/lucy/lucy_test.go     | 10 ----------
 2 files changed, 29 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/64156f43/go/lucy/analysis_test.go
----------------------------------------------------------------------
diff --git a/go/lucy/analysis_test.go b/go/lucy/analysis_test.go
new file mode 100644
index 0000000..26a30d5
--- /dev/null
+++ b/go/lucy/analysis_test.go
@@ -0,0 +1,29 @@
+/* Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package lucy
+
+import "testing"
+import "reflect"
+
+func TestRegexTokenizerSplit(t *testing.T) {
+	tokenizer := NewRegexTokenizer("\\S+")
+	var expected []interface{} = []interface{}{"foo", "bar", "baz"}
+	got := tokenizer.Split("foo bar baz")
+	if !reflect.DeepEqual(got, expected) {
+		t.Errorf("Expected %v, got %v", expected, got)
+	}
+}

http://git-wip-us.apache.org/repos/asf/lucy/blob/64156f43/go/lucy/lucy_test.go
----------------------------------------------------------------------
diff --git a/go/lucy/lucy_test.go b/go/lucy/lucy_test.go
index 8f11a3d..fce0435 100644
--- a/go/lucy/lucy_test.go
+++ b/go/lucy/lucy_test.go
@@ -18,7 +18,6 @@ package lucy
 
 import "git-wip-us.apache.org/repos/asf/lucy-clownfish.git/runtime/go/clownfish"
 import "testing"
-import "reflect"
 
 type testDoc struct {
 	Content string
@@ -70,12 +69,3 @@ func TestOpenIndexer(t *testing.T) {
 		t.Error("Didn't catch exception opening indexer")
 	}
 }
-
-func TestRegex(t *testing.T) {
-	tokenizer := NewRegexTokenizer("\\S+")
-	var expected []interface{} = []interface{}{"foo", "bar", "baz"}
-	got := tokenizer.Split("foo bar baz")
-	if !reflect.DeepEqual(got, expected) {
-		t.Errorf("Expected %v, got %v", expected, got)
-	}
-}


Mime
View raw message