From 84c55311d1e7a433d66045467499fab971918dc6 Mon Sep 17 00:00:00 2001 From: lew Date: Wed, 11 Feb 2026 00:08:34 +0000 Subject: [PATCH] chore: add license headers and --drop golden test --- cmd/ndjson.go | 22 ++++++++++++++++++++++ cmd/ndjson_test.go | 22 ++++++++++++++++++++++ testdata/restore__drop__ok.ct | 9 +++++++++ 3 files changed, 53 insertions(+) create mode 100644 testdata/restore__drop__ok.ct diff --git a/cmd/ndjson.go b/cmd/ndjson.go index fa3e829..458b5a4 100644 --- a/cmd/ndjson.go +++ b/cmd/ndjson.go @@ -1,3 +1,25 @@ +/* +Copyright © 2025 Lewis Wynne + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +*/ + package cmd import ( diff --git a/cmd/ndjson_test.go b/cmd/ndjson_test.go index 3deb593..bacc3aa 100644 --- a/cmd/ndjson_test.go +++ b/cmd/ndjson_test.go @@ -1,3 +1,25 @@ +/* +Copyright © 2025 Lewis Wynne + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +*/ + package cmd import ( diff --git a/testdata/restore__drop__ok.ct b/testdata/restore__drop__ok.ct new file mode 100644 index 0000000..b5c18f1 --- /dev/null +++ b/testdata/restore__drop__ok.ct @@ -0,0 +1,9 @@ +$ pda set existing keep-me +$ pda set other also-keep +$ fecho dumpfile {"key":"new","value":"hello","encoding":"text"} +$ pda restore --drop --file dumpfile +Restored 1 entries into @default +$ pda get new +hello +$ pda get existing --> FAIL +Error: cannot get 'existing': No such key