Skip to content

Commit

Permalink
removed the buckets tests for its own test file
Browse files Browse the repository at this point in the history
Signed-off-by: tommy shem <[email protected]>
  • Loading branch information
tommy shem committed Nov 12, 2024
1 parent 3f2dd49 commit b89ce20
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 33 deletions.
Binary file added cmd/bbolt/bbolt.exe
Binary file not shown.
6 changes: 3 additions & 3 deletions cmd/bbolt/command_version.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ func newVersionCommand() *cobra.Command {
Short: "print the current version of bbolt",
Long: "print the current version of bbolt",
Run: func(cmd *cobra.Command, args []string) {
fmt.Printf("bbolt Version: %s\n", version.Version)
fmt.Printf("Go Version: %s\n", runtime.Version())
fmt.Printf("Go OS/Arch: %s/%s\n", runtime.GOOS, runtime.GOARCH)
fmt.Fprintln(cmd.OutOrStdout(), "bbolt Version: ", version.Version)
fmt.Fprintln(cmd.OutOrStdout(), "Go Version: ", runtime.Version())
fmt.Fprintln(cmd.OutOrStdout(), "Go OS/Arch: ", runtime.GOOS, "/", runtime.GOARCH)
},
}

Expand Down
30 changes: 0 additions & 30 deletions cmd/bbolt/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -274,36 +274,6 @@ func TestStatsCommand_Run(t *testing.T) {
}
}

// Ensure the "buckets" command can print a list of buckets.
func TestBucketsCommand_Run(t *testing.T) {
db := btesting.MustCreateDB(t)

if err := db.Update(func(tx *bolt.Tx) error {
for _, name := range []string{"foo", "bar", "baz"} {
_, err := tx.CreateBucket([]byte(name))
if err != nil {
return err
}
}
return nil
}); err != nil {
t.Fatal(err)
}
db.Close()

defer requireDBNoChange(t, dbData(t, db.Path()), db.Path())

expected := "bar\nbaz\nfoo\n"

// Run the command.
m := NewMain()
if err := m.Run("buckets", db.Path()); err != nil {
t.Fatal(err)
} else if actual := m.Stdout.String(); actual != expected {
t.Fatalf("unexpected stdout:\n\n%s", actual)
}
}

// Ensure the "keys" command can print a list of keys for a bucket.
func TestKeysCommand_Run(t *testing.T) {
testCases := []struct {
Expand Down

0 comments on commit b89ce20

Please sign in to comment.