|
| 1 | +RUN: rm -rf %t %t.cas |
| 2 | +RUN: mkdir %t |
| 3 | + |
| 4 | +RUN: llvm-cas --cas %t.cas --make-blob \ |
| 5 | +RUN: --data - </dev/null >%t/empty.casid |
| 6 | +RUN: sed -e 's,^.,CHECK: ,' <%t/empty.casid >%t/empty.check |
| 7 | +RUN: llvm-cas --cas %t.cas --make-blob \ |
| 8 | +RUN: --data /dev/null | FileCheck %t/empty.check |
| 9 | +RUN: echo "abc" | \ |
| 10 | +RUN: llvm-cas --cas %t.cas --make-blob \ |
| 11 | +RUN: --data - >%t/abc.casid |
| 12 | +RUN: llvm-cas --cas %t.cas --make-blob \ |
| 13 | +RUN: --data %S/Inputs/oneline >%t/oneline.casid |
| 14 | +RUN: llvm-cas --cas %t.cas --make-blob \ |
| 15 | +RUN: --data %S/Inputs/oneline-nonewline >%t/oneline-nonewline.casid |
| 16 | + |
| 17 | +RUN: llvm-cas --cas %t.cas --cat-blob @%t/empty.casid |\ |
| 18 | +RUN: FileCheck %s -check-prefix CHECK-EMPTY -allow-empty |
| 19 | +RUN: llvm-cas --cas %t.cas --print-kind @%t/empty.casid |\ |
| 20 | +RUN: FileCheck %s -check-prefix CHECK-KIND |
| 21 | +CHECK-EMPTY-NOT: {{.}} |
| 22 | +CHECK-KIND: object |
| 23 | + |
| 24 | +RUN: llvm-cas --cas %t.cas --cat-blob @%t/abc.casid |\ |
| 25 | +RUN: FileCheck %s -check-prefix CHECK-ABC |
| 26 | +RUN: llvm-cas --cas %t.cas --print-kind @%t/abc.casid |\ |
| 27 | +RUN: FileCheck %s -check-prefix CHECK-KIND |
| 28 | +CHECK-ABC: abc |
| 29 | + |
| 30 | +RUN: llvm-cas --cas %t.cas --cat-blob @%t/oneline-nonewline.casid |\ |
| 31 | +RUN: FileCheck %s -check-prefix CHECK-ONELINE |
| 32 | +RUN: llvm-cas --cas %t.cas --cat-blob @%t/oneline.casid |\ |
| 33 | +RUN: FileCheck %s -check-prefix CHECK-ONELINE |
| 34 | +CHECK-ONELINE: content |
| 35 | + |
| 36 | +# Double-check newlines. |
| 37 | +RUN: llvm-cas --cas %t.cas --cat-blob @%t/oneline-nonewline.casid \ |
| 38 | +RUN: >%t/oneline-nonewline |
| 39 | +RUN: diff %S/Inputs/oneline-nonewline %t/oneline-nonewline |
| 40 | +RUN: llvm-cas --cas %t.cas --cat-blob @%t/oneline.casid \ |
| 41 | +RUN: >%t/oneline |
| 42 | +RUN: diff %S/Inputs/oneline %t/oneline |
0 commit comments