chiark / gitweb /
[PATCH] add tests to catch whitespace and comment config file parsing errors.
[elogind.git] / test / udev-test.pl
index 08b99f041ffc9b39c01c10f16a783f2e0aedbb74..7afbd0d6fc34c0e7adce79ceb6313d9f76a1d7e0 100644 (file)
@@ -101,6 +101,39 @@ EOF
                expected => "visor" ,
                conf     => <<EOF
 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
        },
        {