[Toybox] [PATCH] sed.test: remove accidental newlines.

Rob Landley rob at landley.net
Mon May 6 15:03:08 PDT 2019


On 5/6/19 10:40 AM, enh via Toybox wrote:
> ---
>  tests/sed.test | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/sed.test b/tests/sed.test
> index 6b27fff8..04603a21 100755
> --- a/tests/sed.test
> +++ b/tests/sed.test
> @@ -169,11 +169,11 @@ testing '-z' 'sed -z "s/\n/-/g"' "a-b-c" "" "a\nb\nc"
> 
>  # toybox handling of empty capturing groups broke minjail. Check that we
>  # correctly replace an empty capturing group with the empty string:
> -testing '\n with empty capture' \
> +testing '\N with empty capture' \
>      'sed -E "s/(ARM_)?(NR_)([a-z]*) (.*)/\1\2\3/"' "NR_read" "" "NR_read foo"
>  # ...but also that we report an error for a backreference to a group that
>  # isn't in the pattern:
> -testing '\n too high' \
> +testing '\N too high' \
>      'sed -E "s/(.*)/\2/p" 2>/dev/null || echo OK' "OK\n" "" "foo"
> 
>  # -i with $ last line test

Um, I'm not seeing these as newlines? Hmmm... scripts/runtest.sh function
testing()...

  NAME="$CMDNAME $1"
  echo "$SHOWPASS: $NAME"

So your echo is defaulting to -e (and debian's isn't), which is why you needed
-E. Except we _just_ added -E to toybox and I'm not quite comfortable trusting
it to be there on the host yet...

Ah, printf is in aosp/prebuilts/build-tools/linux-x86/bin/toybox (which took 14
hours to download through my cable modem, but is now on my laptop). Does
switching to that fix it?

Rob



More information about the Toybox mailing list