]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test-udev: add more tests for line continuation
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 21 Feb 2019 09:03:32 +0000 (18:03 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 21 Feb 2019 21:50:20 +0000 (06:50 +0900)
test/udev-test.pl

index a5e1f8cda3835d91b7eb790c5b6d80eca5cda0ef..002fabd9fd6d02f5df5f0c476fc086d9065610ee 100755 (executable)
@@ -1466,8 +1466,42 @@ TAG+="hoge1",\\
 TAG+="hoge2",\\
 # spaces before and after token are dropped
   TAG+="hoge3",   \\
+\\
+ \\
 TAG+="hoge4"
 TAGS=="hoge1", TAGS=="hoge2", TAGS=="hoge3", TAGS=="hoge4", SYMLINK+="found"
+EOF
+        },
+        {
+                desc            => "continuations with empty line",
+                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
+                exp_name        => "found",
+                not_exp_name    => "bad",
+                rules           => <<EOF
+# empty line finishes continuation
+KERNEL=="sda", TAG+="foo" \\
+
+KERNEL=="sdb", TAG+="hoge"
+KERNEL=="sda", TAG+="aaa" \\
+KERNEL=="sdb", TAG+="bbb"
+TAGS=="foo", SYMLINK+="found"
+TAGS=="aaa", SYMLINK+="bad"
+EOF
+        },
+        {
+                desc            => "continuations with white only line",
+                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
+                exp_name        => "found",
+                not_exp_name    => "bad",
+                rules           => <<EOF
+# space only line finishes continuation
+KERNEL=="sda", TAG+="foo" \\
+   \t
+KERNEL=="sdb", TAG+="hoge"
+KERNEL=="sda", TAG+="aaa" \\
+KERNEL=="sdb", TAG+="bbb"
+TAGS=="foo", SYMLINK+="found"
+TAGS=="aaa", SYMLINK+="bad"
 EOF
         },
 );