From 4aca87515a5083ae0e31ce3177189fd43b6d05ac Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Sat, 3 Jan 2015 13:58:15 +0100 Subject: patch to Vanilla Tomato 1.28 --- release/src/router/busybox/testsuite/parse.tests | 109 +++++++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100755 release/src/router/busybox/testsuite/parse.tests (limited to 'release/src/router/busybox/testsuite/parse.tests') diff --git a/release/src/router/busybox/testsuite/parse.tests b/release/src/router/busybox/testsuite/parse.tests new file mode 100755 index 00000000..f1ee7b83 --- /dev/null +++ b/release/src/router/busybox/testsuite/parse.tests @@ -0,0 +1,109 @@ +#!/bin/sh + +# Copyright 2008 by Denys Vlasenko +# Licensed under GPL v2, see file LICENSE for details. + +. testing.sh + +COLLAPSE=$(( 0x00010000)) +TRIM=$(( 0x00020000)) +GREEDY=$(( 0x00040000)) +MIN_DIE=$(( 0x00100000)) +KEEP_COPY=$((0x00200000)) +ESCAPE=$(( 0x00400000)) +NORMAL=$(( COLLAPSE | TRIM | GREEDY)) + +# testing "description" "command" "result" "infile" "stdin" + +testing "parse mdev.conf" \ + "parse -n 4 -m 3 -f $((NORMAL)) -" \ + "[sda][0:0][644][@echo @echo TEST]\n" \ + "-" \ + " sda 0:0 644 @echo @echo TEST # echo trap\n" + +testing "parse notrim" \ + "parse -n 4 -m 3 -f $((NORMAL - TRIM - COLLAPSE)) -" \ + "[][sda][0:0][644 @echo @echo TEST ]\n" \ + "-" \ + " sda 0:0 644 @echo @echo TEST \n" + +FILE=__parse +cat >$FILE <$FILE.res <$FILE.res <$FILE.res <