Skip to content

Commit

Permalink
go fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
faddat committed Jul 4, 2022
1 parent 2f50759 commit efeed00
Show file tree
Hide file tree
Showing 15 changed files with 25 additions and 25 deletions.
1 change: 1 addition & 0 deletions boltdb.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build boltdb
// +build boltdb

package db
Expand Down
1 change: 1 addition & 0 deletions boltdb_batch.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build boltdb
// +build boltdb

package db
Expand Down
1 change: 1 addition & 0 deletions boltdb_iterator.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build boltdb
// +build boltdb

package db
Expand Down
1 change: 1 addition & 0 deletions boltdb_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build boltdb
// +build boltdb

package db
Expand Down
1 change: 1 addition & 0 deletions cleveldb.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build cleveldb
// +build cleveldb

package db
Expand Down
1 change: 1 addition & 0 deletions cleveldb_batch.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build cleveldb
// +build cleveldb

package db
Expand Down
1 change: 1 addition & 0 deletions cleveldb_iterator.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build cleveldb
// +build cleveldb

package db
Expand Down
1 change: 1 addition & 0 deletions cleveldb_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build cleveldb
// +build cleveldb

package db
Expand Down
18 changes: 3 additions & 15 deletions common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@ func checkNext(t *testing.T, itr Iterator, expected bool) {
require.Equal(t, expected, valid)
}

func checkNextPanics(t *testing.T, itr Iterator) {
assert.Panics(t, func() { itr.Next() }, "checkNextPanics expected an error but didn't")
}

func checkDomain(t *testing.T, itr Iterator, start, end []byte) {
ds, de := itr.Domain()
assert.Equal(t, start, ds, "checkDomain domain start incorrect")
Expand All @@ -53,17 +49,9 @@ func checkItem(t *testing.T, itr Iterator, key []byte, value []byte) {

func checkInvalid(t *testing.T, itr Iterator) {
checkValid(t, itr, false)
// checkKeyPanics(t, itr)
// checkValuePanics(t, itr)
// checkNextPanics(t, itr)
}

func checkKeyPanics(t *testing.T, itr Iterator) {
assert.Panics(t, func() { itr.Key() }, "checkKeyPanics expected panic but didn't")
}

func checkValuePanics(t *testing.T, itr Iterator) {
assert.Panics(t, func() { itr.Value() })
// checkKeyPanics(t, itr)
// checkValuePanics(t, itr)
// checkNextPanics(t, itr)
}

func newTempDB(t *testing.T, backend BackendType) (db DB, dbDir string) {
Expand Down
4 changes: 2 additions & 2 deletions db_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func TestDBIteratorSingleKey(t *testing.T) {
checkValid(t, itr, true)
checkNext(t, itr, false)
checkValid(t, itr, false)
// checkNextPanics(t, itr)
// checkNextPanics(t, itr)

// Once invalid...
checkInvalid(t, itr)
Expand Down Expand Up @@ -53,7 +53,7 @@ func TestDBIteratorTwoKeys(t *testing.T) {
checkNext(t, itr, false)
checkValid(t, itr, false)

// checkNextPanics(t, itr)
// checkNextPanics(t, itr)

// Once invalid...
checkInvalid(t, itr)
Expand Down
1 change: 1 addition & 0 deletions rocksdb.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build rocksdb
// +build rocksdb

package db
Expand Down
1 change: 1 addition & 0 deletions rocksdb_batch.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build rocksdb
// +build rocksdb

package db
Expand Down
1 change: 1 addition & 0 deletions rocksdb_iterator.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build rocksdb
// +build rocksdb

package db
Expand Down
1 change: 1 addition & 0 deletions rocksdb_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build rocksdb
// +build rocksdb

package db
Expand Down
16 changes: 8 additions & 8 deletions util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ func TestPrefixIteratorNoMatch1(t *testing.T) {
t.Run(fmt.Sprintf("Prefix w/ backend %s", backend), func(t *testing.T) {
db, dir := newTempDB(t, backend)
defer os.RemoveAll(dir)
// itr, err := IteratePrefix(db, []byte("2"))
// require.NoError(t, err)
// itr, err := IteratePrefix(db, []byte("2"))
// require.NoError(t, err)
err := db.SetSync(bz("1"), bz("value_1"))
require.NoError(t, err)

// checkInvalid(t, itr)
// checkInvalid(t, itr)
})
}
}
Expand All @@ -51,10 +51,10 @@ func TestPrefixIteratorNoMatch2(t *testing.T) {
defer os.RemoveAll(dir)
err := db.SetSync(bz("3"), bz("value_3"))
require.NoError(t, err)
// itr, err := IteratePrefix(db, []byte("4"))
// require.NoError(t, err)
// itr, err := IteratePrefix(db, []byte("4"))
// require.NoError(t, err)

// checkInvalid(t, itr)
// checkInvalid(t, itr)
})
}
}
Expand All @@ -75,7 +75,7 @@ func TestPrefixIteratorMatch1(t *testing.T) {
checkNext(t, itr, false)

// Once invalid...
// checkInvalid(t, itr)
// checkInvalid(t, itr)
})
}
}
Expand Down Expand Up @@ -114,7 +114,7 @@ func TestPrefixIteratorMatches1N(t *testing.T) {
checkNext(t, itr, false)

// Once invalid...
// checkInvalid(t, itr)
// checkInvalid(t, itr)
})
}
}

0 comments on commit efeed00

Please sign in to comment.