view scripts/test/expr.test @ 1271:c214de62b18b draft

Teach cpio to set uid/gid and timestamp. (Timestamp has year 2100 problem.) Note that directory timestamps are still sometimes wrong because creating things in a directory can update the timestamp. Also, cp -r has logic to ensure we can write to a directory that doesn't have write permission, cpio does not. This is fixable, but not what existing cpio does.
author Rob Landley <rob@landley.net>
date Tue, 29 Apr 2014 06:03:17 -0500
parents 74b5cf0309fc
children
line wrap: on
line source

#!/bin/bash

[ -f testing.sh ] && . testing.sh

testing "expr integer" "expr 5" "5\n" "" ""
testing "expr integer negative" "expr -5" "-5\n" "" ""
testing "expr string" "expr astring" "astring\n" "" ""
testing "expr 1 + 3" "expr 1 + 3" "4\n" "" ""
testing "expr 5 + 6 * 3" "expr 5 + 6 \* 3" "23\n" "" ""
testing "expr ( 5 + 6 ) * 3" "expr \( 5 + 6 \) \* 3" "33\n" "" ""