Skip to content

Commit b943b84

Browse files
authored
Merge pull request #9 from jsmorph/packaging
Package reorg; closes #5; see #6
2 parents f390e45 + 99dede1 commit b943b84

38 files changed

+42
-41
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package quamina
1+
package core
22

33
import (
44
"testing"
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package quamina
1+
package core
22

33
import (
44
"bufio"
@@ -53,7 +53,7 @@ const thresholdPerformance = 120000.0
5353
// that it uses geometry/co-ordintes, which will force the fj flattener to process the big arrays of numbers in
5454
// each line. A high proportion of typical Quamina workloads should run faster.
5555
func TestCityLots(t *testing.T) {
56-
file, err := os.Open("../test_data/citylots.jlines")
56+
file, err := os.Open("../testdata/citylots.jlines")
5757
if err != nil {
5858
t.Error("Can't open file: " + err.Error())
5959
}
@@ -183,7 +183,7 @@ func TestMySoftwareHatesMe(t *testing.T) {
183183

184184
// exercise shellstyle matching a little, is much faster than TestCityLots because it's only working wth one field
185185
func TestBigShellStyle(t *testing.T) {
186-
file, err := os.Open("../test_data/citylots.jlines")
186+
file, err := os.Open("../testdata/citylots.jlines")
187187
if err != nil {
188188
t.Error("Can't open file: " + err.Error())
189189
}
@@ -326,7 +326,7 @@ func (w *worder) next() []byte {
326326

327327
func readWWords(t *testing.T) [][]byte {
328328
// that's a list from the Wordle source code with a few erased to get a prime number
329-
file, err := os.Open("../test_data/wwords.txt")
329+
file, err := os.Open("../testdata/wwords.txt")
330330
if err != nil {
331331
t.Error("Can't open file: " + err.Error())
332332
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package quamina
1+
package core
22

33
import (
44
"bufio"
@@ -39,7 +39,7 @@ func TestConcurrency(t *testing.T) {
3939
// I was initially surprised that adding 860 or so changes to the automaton while it's running doesn't seem to
4040
// cause any decrease in performance. But I guess it splits out very cleanly onto another core and really
4141
// doesn't steal any resources from the thread doing the Match calls
42-
file, err := os.Open("../test_data/citylots.jlines")
42+
file, err := os.Open("../testdata/citylots.jlines")
4343
if err != nil {
4444
t.Error("Can't open file: " + err.Error())
4545
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package quamina
1+
package core
22

33
// CoreMatcher represents an automaton that allows matching sequences of name/value field pairs against
44
// patterns, which are combinations of field names and lists of allowed valued field values.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package quamina
1+
package core
22

33
import (
44
"fmt"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package quamina
1+
package core
22

33
import (
44
"testing"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package quamina
1+
package core
22

33
// fieldMatcher represents a state in the matching automaton, which matches field names and dispatches to
44
// valueMatcher to complete matching of name/value combinations. fieldMatcher has a map which is keyed by the

lib/fj.go renamed to core/fj.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package quamina
1+
package core
22

33
import (
44
"errors"

lib/fj_test.go renamed to core/fj_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package quamina
1+
package core
22

33
import (
44
"io/ioutil"
@@ -58,7 +58,7 @@ func TestFJBasic(t *testing.T) {
5858
func TestFJ10Lines(t *testing.T) {
5959

6060
geo := fakeMatcher("type", "geometry")
61-
testTrackerSelection(NewFJ(geo), "L0", "../test_data/cl-sample-0",
61+
testTrackerSelection(NewFJ(geo), "L0", "../testdata/cl-sample-0",
6262
[]string{"type", "geometry\ntype"},
6363
[]string{`"Feature"`, `"Polygon"`},
6464
t)
@@ -99,13 +99,13 @@ func TestFJ10Lines(t *testing.T) {
9999
}
100100

101101
coords := fakeMatcher("coordinates", "geometry")
102-
testTrackerSelection(NewFJ(coords), "L1", "../test_data/cl-sample-1",
102+
testTrackerSelection(NewFJ(coords), "L1", "../testdata/cl-sample-1",
103103
coordNames, coordVals, t)
104104

105105
l2names := []string{"properties\nFROM_ST", "properties\nODD_EVEN"}
106106
l2vals := []string{`"1917"`, `"O"`}
107107
proFoOd := fakeMatcher("properties", "FROM_ST", "ODD_EVEN")
108-
testTrackerSelection(NewFJ(proFoOd), "L2", "../test_data/cl-sample-2",
108+
testTrackerSelection(NewFJ(proFoOd), "L2", "../testdata/cl-sample-2",
109109
l2names, l2vals, t)
110110
}
111111

lib/flattener.go renamed to core/flattener.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package quamina
1+
package core
22

33
type ArrayPos struct {
44
Array int32

0 commit comments

Comments
 (0)