yeah, works for me. although i don't understand _why_ that works --- i
thought the long name had to come after the corresponding short name?

new tests attached.

On Tue, Nov 17, 2020 at 11:50 AM Rob Landley <r...@landley.net> wrote:
>
> On 11/17/20 12:06 PM, enh via Toybox wrote:
> > https://github.com/landley/toybox/commit/52bbc1e0a410b44a926b04aaae3b00f9f50da81e
> > seems to have broken `printenv -0`. (`printenv --null` still works.)
> >
> > /tmp/toybox$ ./toybox printenv --null LOGNAME | xxd
> > 00000000: 656e 6800                                enh.
> > /tmp/toybox$ ./toybox printenv -0 LOGNAME | xxd
> > printenv: Unknown option '0' (see "printenv --help")
> >
> > since printenv doesn't have other options, the workaround used in env
> > doesn't seem to apply...
>
> Huh. (I need to fill out the test suite...)
>
> Fixed it by cheating. Try now?
>
> Thanks,
>
> Rob
> _______________________________________________
> Toybox mailing list
> Toybox@lists.landley.net
> http://lists.landley.net/listinfo.cgi/toybox-landley.net
From 621cfde97f77ca55f9ca651448543ec210216a97 Mon Sep 17 00:00:00 2001
From: Elliott Hughes <e...@google.com>
Date: Tue, 17 Nov 2020 11:59:41 -0800
Subject: [PATCH] printenv: add basic tests.

In case I'm not paying attention to the diff of the generated files next
time...
---
 tests/printenv.test | 11 +++++++++++
 1 file changed, 11 insertions(+)
 create mode 100755 tests/printenv.test

diff --git a/tests/printenv.test b/tests/printenv.test
new file mode 100755
index 00000000..5799e969
--- /dev/null
+++ b/tests/printenv.test
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+[ -f testing.sh ] && . testing.sh
+
+#testing "name" "command" "result" "infile" "stdin"
+
+export foo="a b"
+testing "default" "printenv foo | xxd -p" "6120620a\n" "" ""
+testing "-0" "printenv -0 foo | xxd -p" "61206200\n" "" ""
+testing "--null" "printenv --null foo | xxd -p" "61206200\n" "" ""
+unset foo
-- 
2.29.2.299.gdc1121823c-goog

_______________________________________________
Toybox mailing list
Toybox@lists.landley.net
http://lists.landley.net/listinfo.cgi/toybox-landley.net

Reply via email to