From 0bc5a9650c38dd2e65720f339336abd8325f046c Mon Sep 17 00:00:00 2001 From: lew Date: Thu, 20 Nov 2025 15:30:20 +0000 Subject: [PATCH] test(set): TTL --- testdata/set__err__with__invalid-ttl.ct | 12 ++++++++++++ testdata/set__ok__with__secret_ttl.ct | 1 + testdata/set__ok__with__ttl.ct | 1 + 3 files changed, 14 insertions(+) create mode 100644 testdata/set__err__with__invalid-ttl.ct create mode 100644 testdata/set__ok__with__secret_ttl.ct create mode 100644 testdata/set__ok__with__ttl.ct diff --git a/testdata/set__err__with__invalid-ttl.ct b/testdata/set__err__with__invalid-ttl.ct new file mode 100644 index 0000000..9935ca4 --- /dev/null +++ b/testdata/set__err__with__invalid-ttl.ct @@ -0,0 +1,12 @@ +$ 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) diff --git a/testdata/set__ok__with__secret_ttl.ct b/testdata/set__ok__with__secret_ttl.ct new file mode 100644 index 0000000..7ad9b4f --- /dev/null +++ b/testdata/set__ok__with__secret_ttl.ct @@ -0,0 +1 @@ +$ pda set a b --secret --ttl 10m diff --git a/testdata/set__ok__with__ttl.ct b/testdata/set__ok__with__ttl.ct new file mode 100644 index 0000000..ba410d8 --- /dev/null +++ b/testdata/set__ok__with__ttl.ct @@ -0,0 +1 @@ +$ pda set a b --ttl 30m