chiark / gitweb /
[PATCH] add tests to catch whitespace and comment config file parsing errors.
authorgreg@kroah.com <greg@kroah.com>
Thu, 18 Dec 2003 02:28:05 +0000 (18:28 -0800)
committerGreg KH <gregkh@suse.de>
Wed, 27 Apr 2005 04:13:09 +0000 (21:13 -0700)
test/udev-test.pl

index 08b99f0..7afbd0d 100644 (file)
@@ -104,6 +104,39 @@ REPLACE, KERNEL="ttyUSB0", NAME="visor"
 EOF
        },
        {
+               desc     => "Handle comment lines in config file (and replace kernel name)",
+               subsys   => "tty",
+               devpath  => "class/tty/ttyUSB0",
+               expected => "visor" ,
+               conf     => <<EOF
+# this is a comment
+REPLACE, KERNEL="ttyUSB0", NAME="visor"
+
+EOF
+       },
+       {
+               desc     => "Handle comment lines in config file with whitespace (and replace kernel name)",
+               subsys   => "tty",
+               devpath  => "class/tty/ttyUSB0",
+               expected => "visor" ,
+               conf     => <<EOF
+ # this is a comment with whitespace before the comment 
+REPLACE, KERNEL="ttyUSB0", NAME="visor"
+
+EOF
+       },
+       {
+               desc     => "Handle empty lines in config file (and replace kernel name)",
+               subsys   => "tty",
+               devpath  => "class/tty/ttyUSB0",
+               expected => "visor" ,
+               conf     => <<EOF
+
+REPLACE, KERNEL="ttyUSB0", NAME="visor"
+
+EOF
+       },
+       {
                desc     => "subdirectory handling",
                subsys   => "tty",
                devpath  => "class/tty/ttyUSB0",