[Toybox] [PATCH 1/2] ls: Add tests for `-C` and `-x` options

Andrew Ilijic ilijic.andrew at gmail.com
Thu Oct 24 06:47:46 PDT 2019


For context see the mailing list link below.
https://www.mail-archive.com/toybox@lists.landley.net/msg05991.html

>From fe97757c4a9a3b1b917727d1db207f4d3c478c92 Mon Sep 17 00:00:00 2001
From: Andrew Ilijic <ilijic.andrew at gmail.com>
Date: Thu, 24 Oct 2019 09:09:28 -0400
Subject: [PATCH 1/2] ls: Add tests for `-C` and `-x` options

These tests ensure we follow the behavior of other `ls` commands, in the basic
case.
---
 tests/ls.test | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tests/ls.test b/tests/ls.test
index 91f69183..ab67bbe9 100755
--- a/tests/ls.test
+++ b/tests/ls.test
@@ -18,6 +18,8 @@ IN="cd lstest"
 OUT="cd .. "

 testing "no argument" "$IN && ls; $OUT"
"dir1\ndir2\nfile1.txt\nfile2.txt\n" "" ""
+testing "with -C: test column spacing equals 2" "$IN && ls -C; $OUT"
"dir1  dir2  file1.txt  file2.txt\n" "" ""
+testing "with -x: test column spacing equals 2" "$IN && ls -x; $OUT"
"dir1  dir2  file1.txt  file2.txt\n" "" ""
 testing "with wild char" "$IN && ls file*; $OUT" "file1.txt\nfile2.txt\n" "" ""
 testing "with wild char - long listing" "$IN && ls -1 file*; $OUT"
"file1.txt\nfile2.txt\n" "" ""
 testing "with -p" "$IN && ls -p; $OUT"
"dir1/\ndir2/\nfile1.txt\nfile2.txt\n" "" ""
--
2.11.0
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-ls-Add-tests-for-C-and-x-options.patch
Type: text/x-patch
Size: 1123 bytes
Desc: not available
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20191024/43463409/attachment-0002.bin>


More information about the Toybox mailing list