chiark / gitweb /
[PATCH] add tests for NAME="foo-%c{N}"
authorpatmans@us.ibm.com <patmans@us.ibm.com>
Thu, 4 Mar 2004 08:55:22 +0000 (00:55 -0800)
committerGreg KH <gregkh@suse.de>
Wed, 27 Apr 2005 04:35:08 +0000 (21:35 -0700)
Here is a patch for some new tests.

test/udev-test.pl

index 6b7f515..60cf169 100644 (file)
@@ -262,6 +262,24 @@ BUS="scsi", PROGRAM="/bin/echo -n foo3 foo4 foo5 foo6 foo7 foo8 foo9", KERNEL="s
 EOF
        },
        {
+               desc     => "characters before the %c{N} substitution",
+               subsys   => "block",
+               devpath  => "block/sda/sda3",
+               expected => "my-foo9" ,
+               conf     => <<EOF
+BUS="scsi", PROGRAM="/bin/echo -n foo3 foo4 foo5 foo6 foo7 foo8 foo9", KERNEL="sda3", NAME="my-%c{7}"
+EOF
+       },
+       {
+               desc     => "substitute the second to last argument",
+               subsys   => "block",
+               devpath  => "block/sda/sda3",
+               expected => "my-foo8" ,
+               conf     => <<EOF
+BUS="scsi", PROGRAM="/bin/echo -n foo3 foo4 foo5 foo6 foo7 foo8 foo9", KERNEL="sda3", NAME="my-%c{6}"
+EOF
+       },
+       {
                desc     => "program result substitution (numbered part of)",
                subsys   => "block",
                devpath  => "block/sda/sda3",