From owner-svn-src-user@freebsd.org Mon Sep 28 01:58:30 2015 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9FE6CA0B425 for ; Mon, 28 Sep 2015 01:58:30 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 75AA5BE3; Mon, 28 Sep 2015 01:58:30 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t8S1wUEo003948; Mon, 28 Sep 2015 01:58:30 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t8S1wUvW003947; Mon, 28 Sep 2015 01:58:30 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201509280158.t8S1wUvW003947@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 28 Sep 2015 01:58:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r288322 - user/ngie/more-tests/bin/ls/tests X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Sep 2015 01:58:30 -0000 Author: ngie Date: Mon Sep 28 01:58:29 2015 New Revision: 288322 URL: https://svnweb.freebsd.org/changeset/base/288322 Log: Add testcases for -B and -l, Modified: user/ngie/more-tests/bin/ls/tests/ls_tests.sh Modified: user/ngie/more-tests/bin/ls/tests/ls_tests.sh ============================================================================== --- user/ngie/more-tests/bin/ls/tests/ls_tests.sh Mon Sep 28 01:17:31 2015 (r288321) +++ user/ngie/more-tests/bin/ls/tests/ls_tests.sh Mon Sep 28 01:58:29 2015 (r288322) @@ -44,11 +44,13 @@ create_test_inputs() atf_check -e empty -s exit:0 touch .f atf_check -e empty -s exit:0 mkdir .g atf_check -e empty -s exit:0 mkfifo h + atf_check -e ignore -s exit:0 dd if=/dev/zero of=i count=1000 bs=1 } atf_test_case A_flag A_flag_head() { + atf_set "descr" "Verify -A support with unprivileged users" } A_flag_body() @@ -99,17 +101,30 @@ A_flag_implied_when_root_body() atf_check_equal "$(cat $WITH_EXPLICIT)" "$(cat $WITH_IMPLIED)" } +atf_test_case B_flag +B_flag_head() +{ + atf_set "descr" "Verify that the output from ls -B prints out non-printable characters" +} + +B_flag_body() +{ + + atf_check -e empty -o empty -s exit:0 touch "$(printf "y\013z")" + atf_check -e empty -o match:'y\\013z' -s exit:0 ls -B +} + atf_test_case C_flag C_flag_head() { - atf_set "descr" "Verify that the output from ls -C" + atf_set "descr" "Verify that the output from ls -C is multi-column" } C_flag_body() { create_test_inputs - atf_check -e empty -o match:"$(printf 'a[[:space:]]+c[[:space:]]+d[[:space:]]+e[[:space:]]+h\n')" -s exit:0 ls -C + atf_check -e empty -o match:"$(printf 'a[[:space:]]+c[[:space:]]+d[[:space:]]+e[[:space:]]+h[[:space:]]i\n')" -s exit:0 ls -C } atf_test_case I_flag @@ -154,6 +169,20 @@ I_flag_voids_A_flag_when_root_body() atf_check -o match:'\.g' -s exit:0 ls -A -I } +lcomma_flag_head() +{ + atf_set "descr" "Verify that -l, prints out the size with , delimiters" +} + +lcomma_flag_body() +{ + create_test_inputs + + atf_check \ + -o match:'\-rw\-r\-\-r\-\-[[:space:]]+.+[[:space:]]+1,000[[:space:]]+.+i' \ + env LC_ALL=en_US.ISO8859-1 ls -l, i +} + 1_flag_head() { atf_set "descr" "Verify that -1 prints out one item per line" @@ -183,8 +212,10 @@ atf_init_test_cases() atf_add_test_case A_flag atf_add_test_case A_flag_implied_when_root + atf_add_test_case B_flag atf_add_test_case C_flag atf_add_test_case I_flag atf_add_test_case I_flag_voids_A_flag_when_root + atf_add_test_case lcomma_flag atf_add_test_case 1_flag }