chore(testdata): updates test expectations to match new error messaging

This commit is contained in:
Lewis Wynne 2025-12-17 14:28:18 +00:00
parent 06e09df829
commit def2941128
10 changed files with 22 additions and 173 deletions

View file

@ -81,7 +81,10 @@ func del(cmd *cobra.Command, args []string) error {
if err := tx.Delete(k); errors.Is(err, badger.ErrKeyNotFound) {
return fmt.Errorf("cannot remove '%s': No such key", args[0])
}
return fmt.Errorf("cannot remove '%s': %v", args[0], err)
if err != nil {
return fmt.Errorf("cannot remove '%s': %v", args[0], err)
}
return nil
},
}

View file

@ -1,14 +1,2 @@
$ pda get foobar --> FAIL
Error: Key not found
Usage:
pda get KEY[@DB] [flags]
Aliases:
get, g
Flags:
-h, --help help for get
-b, --include-binary include binary data in text output
--no-template directly output template syntax
-c, --run execute the result as a shell command
--secret display values marked as secret
Error: cannot get 'foobar': Key not found

View file

@ -5,100 +5,10 @@ $ pda get foobar --include-binary --run --secret --> FAIL
$ pda get foobar --run --> FAIL
$ pda get foobar --run --secret --> FAIL
$ pda get foobar --secret --> FAIL
Error: Key not found
Usage:
pda get KEY[@DB] [flags]
Aliases:
get, g
Flags:
-h, --help help for get
-b, --include-binary include binary data in text output
--no-template directly output template syntax
-c, --run execute the result as a shell command
--secret display values marked as secret
Error: Key not found
Usage:
pda get KEY[@DB] [flags]
Aliases:
get, g
Flags:
-h, --help help for get
-b, --include-binary include binary data in text output
--no-template directly output template syntax
-c, --run execute the result as a shell command
--secret display values marked as secret
Error: Key not found
Usage:
pda get KEY[@DB] [flags]
Aliases:
get, g
Flags:
-h, --help help for get
-b, --include-binary include binary data in text output
--no-template directly output template syntax
-c, --run execute the result as a shell command
--secret display values marked as secret
Error: Key not found
Usage:
pda get KEY[@DB] [flags]
Aliases:
get, g
Flags:
-h, --help help for get
-b, --include-binary include binary data in text output
--no-template directly output template syntax
-c, --run execute the result as a shell command
--secret display values marked as secret
Error: Key not found
Usage:
pda get KEY[@DB] [flags]
Aliases:
get, g
Flags:
-h, --help help for get
-b, --include-binary include binary data in text output
--no-template directly output template syntax
-c, --run execute the result as a shell command
--secret display values marked as secret
Error: Key not found
Usage:
pda get KEY[@DB] [flags]
Aliases:
get, g
Flags:
-h, --help help for get
-b, --include-binary include binary data in text output
--no-template directly output template syntax
-c, --run execute the result as a shell command
--secret display values marked as secret
Error: Key not found
Usage:
pda get KEY[@DB] [flags]
Aliases:
get, g
Flags:
-h, --help help for get
-b, --include-binary include binary data in text output
--no-template directly output template syntax
-c, --run execute the result as a shell command
--secret display values marked as secret
Error: cannot get 'foobar': Key not found
Error: cannot get 'foobar': Key not found
Error: cannot get 'foobar': Key not found
Error: cannot get 'foobar': Key not found
Error: cannot get 'foobar': Key not found
Error: cannot get 'foobar': Key not found
Error: cannot get 'foobar': Key not found

View file

@ -1,15 +1,3 @@
$ pda set a b --secret
$ pda get a --> FAIL
Error: "a" is marked secret; re-run with --secret to display it
Usage:
pda get KEY[@DB] [flags]
Aliases:
get, g
Flags:
-h, --help help for get
-b, --include-binary include binary data in text output
--no-template directly output template syntax
-c, --run execute the result as a shell command
--secret display values marked as secret
Error: cannot get 'a': marked as secret, run with --secret

View file

@ -1,16 +1,4 @@
$ fecho cmd echo hello world
$ pda set a --secret < cmd
$ pda get a --include-binary --> FAIL
Error: "a" is marked secret; re-run with --secret to display it
Usage:
pda get KEY[@DB] [flags]
Aliases:
get, g
Flags:
-h, --help help for get
-b, --include-binary include binary data in text output
--no-template directly output template syntax
-c, --run execute the result as a shell command
--secret display values marked as secret
Error: cannot get 'a': marked as secret, run with --secret

View file

@ -1,16 +1,4 @@
$ fecho cmd echo hello world
$ pda set a --secret < cmd
$ pda get a --include-binary --run --> FAIL
Error: "a" is marked secret; re-run with --secret to display it
Usage:
pda get KEY[@DB] [flags]
Aliases:
get, g
Flags:
-h, --help help for get
-b, --include-binary include binary data in text output
--no-template directly output template syntax
-c, --run execute the result as a shell command
--secret display values marked as secret
Error: cannot get 'a': marked as secret, run with --secret

View file

@ -1,16 +1,4 @@
$ fecho cmd echo hello world
$ pda set a --secret < cmd
$ pda get a --run --> FAIL
Error: "a" is marked secret; re-run with --secret to display it
Usage:
pda get KEY[@DB] [flags]
Aliases:
get, g
Flags:
-h, --help help for get
-b, --include-binary include binary data in text output
--no-template directly output template syntax
-c, --run execute the result as a shell command
--secret display values marked as secret
Error: cannot get 'a': marked as secret, run with --secret

View file

@ -14,6 +14,7 @@ Usage:
Available Commands:
completion Generate the autocompletion script for the specified shell
cp Make a copy of a key.
del Delete a key. Optionally specify a db.
del-db Delete a database.
dump Dump all key/value pairs as NDJSON
@ -21,6 +22,7 @@ Available Commands:
help Help about any command
list List the contents of a db.
list-dbs List all dbs.
mv Move a key between (or within) databases.
restore Restore key/value pairs from an NDJSON dump
set Set a value for a key by passing VALUE or Stdin. Optionally specify a db.
@ -42,6 +44,7 @@ Usage:
Available Commands:
completion Generate the autocompletion script for the specified shell
cp Make a copy of a key.
del Delete a key. Optionally specify a db.
del-db Delete a database.
dump Dump all key/value pairs as NDJSON
@ -49,6 +52,7 @@ Available Commands:
help Help about any command
list List the contents of a db.
list-dbs List all dbs.
mv Move a key between (or within) databases.
restore Restore key/value pairs from an NDJSON dump
set Set a value for a key by passing VALUE or Stdin. Optionally specify a db.

View file

@ -13,6 +13,7 @@ Usage:
Available Commands:
completion Generate the autocompletion script for the specified shell
cp Make a copy of a key.
del Delete a key. Optionally specify a db.
del-db Delete a database.
dump Dump all key/value pairs as NDJSON
@ -20,6 +21,7 @@ Available Commands:
help Help about any command
list List the contents of a db.
list-dbs List all dbs.
mv Move a key between (or within) databases.
restore Restore key/value pairs from an NDJSON dump
set Set a value for a key by passing VALUE or Stdin. Optionally specify a db.

View file

@ -1,12 +1,2 @@
$ pda set a b --ttl 3343r --> FAIL
Error: invalid argument "3343r" for "-t, --ttl" flag: time: unknown unit "r" in duration "3343r"
Usage:
pda set KEY[@DB] [VALUE] [flags]
Aliases:
set, s
Flags:
-h, --help help for set
--secret Mark the stored value as a secret
-t, --ttl duration Expire the key after the provided duration (e.g. 24h, 30m)