susumu.yata
null+****@clear*****
Thu Jul 2 17:07:11 JST 2015
susumu.yata 2015-07-02 17:07:11 +0900 (Thu, 02 Jul 2015) New Revision: ef11f9ab9b5439b5dd88c896acee3940a58e3a37 https://github.com/groonga/grngo/commit/ef11f9ab9b5439b5dd88c896acee3940a58e3a37 Message: Change the order of functions. Modified files: grngo_test.go Modified: grngo_test.go (+39 -39) =================================================================== --- grngo_test.go 2015-07-02 16:52:08 +0900 (1722e23) +++ grngo_test.go 2015-07-02 17:07:11 +0900 (180ed6c) @@ -287,50 +287,15 @@ func TestDBRefresh(t *testing.T) { } } -func testDBCreateTableWithKey(t *testing.T, keyType string) { - options := NewTableOptions() - options.KeyType = keyType - dirPath, _, db, _ := createTempTable(t, "Table", options) - defer removeTempDB(t, dirPath, db) -} - -func testDBCreateTableWithValue(t *testing.T, valueType string) { - options := NewTableOptions() - options.ValueType = valueType - dirPath, _, db, _ := createTempTable(t, "Table", options) +func TestDBCreateTableWithoutKeyValue(t *testing.T) { + dirPath, _, db, _ := createTempTable(t, "Table", nil) defer removeTempDB(t, dirPath, db) } -func testDBCreateTableWithRefKey(t *testing.T, keyType string) { - options := NewTableOptions() - options.KeyType = keyType - dirPath, _, db, _ := createTempTable(t, "To", options) - defer removeTempDB(t, dirPath, db) - - options = NewTableOptions() - options.KeyType = "To" - _, err := db.CreateTable("From", options) - if err != nil { - t.Fatalf("DB.CreateTable() failed: %v", err) - } -} - -func testDBCreateTableWithRefValue(t *testing.T, keyType string) { +func testDBCreateTableWithKey(t *testing.T, keyType string) { options := NewTableOptions() options.KeyType = keyType - dirPath, _, db, _ := createTempTable(t, "To", options) - defer removeTempDB(t, dirPath, db) - - options = NewTableOptions() - options.ValueType = "" - _, err := db.CreateTable("From", options) - if err != nil { - t.Fatalf("DB.CreateTable() failed: %v", err) - } -} - -func TestDBCreateTableWithoutKeyValue(t *testing.T) { - dirPath, _, db, _ := createTempTable(t, "Table", nil) + dirPath, _, db, _ := createTempTable(t, "Table", options) defer removeTempDB(t, dirPath, db) } @@ -358,6 +323,13 @@ func TestDBCreateTableWithWGS84GeoPointKey(t *testing.T) { testDBCreateTableWithKey(t, "WGS84GeoPoint") } +func testDBCreateTableWithValue(t *testing.T, valueType string) { + options := NewTableOptions() + options.ValueType = valueType + dirPath, _, db, _ := createTempTable(t, "Table", options) + defer removeTempDB(t, dirPath, db) +} + func TestDBCreateTableWithBoolValue(t *testing.T) { testDBCreateTableWithValue(t, "Bool") } @@ -410,6 +382,20 @@ func TestDBCreateTableWithWGS84GeoPointValue(t *testing.T) { testDBCreateTableWithValue(t, "WGS84GeoPoint") } +func testDBCreateTableWithRefKey(t *testing.T, keyType string) { + options := NewTableOptions() + options.KeyType = keyType + dirPath, _, db, _ := createTempTable(t, "To", options) + defer removeTempDB(t, dirPath, db) + + options = NewTableOptions() + options.KeyType = "To" + _, err := db.CreateTable("From", options) + if err != nil { + t.Fatalf("DB.CreateTable() failed: %v", err) + } +} + func TestDBCreateTableWithBoolRefKey(t *testing.T) { testDBCreateTableWithRefKey(t, "Bool") } @@ -466,6 +452,20 @@ func TestDBCreateTableWithWGS84GeoPointRefKey(t *testing.T) { testDBCreateTableWithRefKey(t, "WGS84GeoPoint") } +func testDBCreateTableWithRefValue(t *testing.T, keyType string) { + options := NewTableOptions() + options.KeyType = keyType + dirPath, _, db, _ := createTempTable(t, "To", options) + defer removeTempDB(t, dirPath, db) + + options = NewTableOptions() + options.ValueType = "" + _, err := db.CreateTable("From", options) + if err != nil { + t.Fatalf("DB.CreateTable() failed: %v", err) + } +} + func TestDBCreateTableWithBoolRefValue(t *testing.T) { testDBCreateTableWithRefValue(t, "Bool") } -------------- next part -------------- HTML����������������������������...Download