xref: /aosp_15_r20/external/toybox/tests/comm.test (revision cf5a6c84e2b8763fc1a7db14496fd4742913b199)
1#!/bin/bash
2
3[ -f testing.sh ] && . testing.sh
4
5#testing "name" "command" "result" "infile" "stdin"
6
7echo -e 'a\nb\nc'> lhs
8for i in c d e ; do echo $i >> rhs ; done
9testing "comm" "comm lhs input" "a\nb\n\t\tc\n\td\n\te\n" "c\nd\ne\n" ""
10testing "comm -" "comm - input" "a\nb\n\t\tc\n\td\n\te\n" "c\nd\ne\n" "a\nb\nc\n"
11testing "comm -123 detects missing" "comm - missing 2>/dev/null || echo here" \
12  "here\n" "" ""
13