21255d
From ac0def8fb2b51a17b7ef256c5c0edf786fffff2a Mon Sep 17 00:00:00 2001
21255d
From: Yu Watanabe <watanabe.yu+github@gmail.com>
21255d
Date: Thu, 21 Feb 2019 18:03:32 +0900
21255d
Subject: [PATCH] test-udev: add more tests for line continuation
21255d
21255d
(cherry picked from commit 84a0819c9d89a2ddb195a5d975ae1fd5c62fde3c)
21255d
21255d
Related: #1642728
21255d
---
21255d
 test/udev-test.pl | 34 ++++++++++++++++++++++++++++++++++
21255d
 1 file changed, 34 insertions(+)
21255d
21255d
diff --git a/test/udev-test.pl b/test/udev-test.pl
21255d
index a5e1f8cda3..002fabd9fd 100755
21255d
--- a/test/udev-test.pl
21255d
+++ b/test/udev-test.pl
21255d
@@ -1466,8 +1466,42 @@ TAG+="hoge1",\\
21255d
 TAG+="hoge2",\\
21255d
 # spaces before and after token are dropped
21255d
   TAG+="hoge3",   \\
21255d
+\\
21255d
+ \\
21255d
 TAG+="hoge4"
21255d
 TAGS=="hoge1", TAGS=="hoge2", TAGS=="hoge3", TAGS=="hoge4", SYMLINK+="found"
21255d
+EOF
21255d
+        },
21255d
+        {
21255d
+                desc            => "continuations with empty line",
21255d
+                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
21255d
+                exp_name        => "found",
21255d
+                not_exp_name    => "bad",
21255d
+                rules           => <
21255d
+# empty line finishes continuation
21255d
+KERNEL=="sda", TAG+="foo" \\
21255d
+
21255d
+KERNEL=="sdb", TAG+="hoge"
21255d
+KERNEL=="sda", TAG+="aaa" \\
21255d
+KERNEL=="sdb", TAG+="bbb"
21255d
+TAGS=="foo", SYMLINK+="found"
21255d
+TAGS=="aaa", SYMLINK+="bad"
21255d
+EOF
21255d
+        },
21255d
+        {
21255d
+                desc            => "continuations with white only line",
21255d
+                devpath         => "/devices/pci0000:00/0000:00:1f.2/host0/target0:0:0/0:0:0:0/block/sda",
21255d
+                exp_name        => "found",
21255d
+                not_exp_name    => "bad",
21255d
+                rules           => <
21255d
+# space only line finishes continuation
21255d
+KERNEL=="sda", TAG+="foo" \\
21255d
+   \t
21255d
+KERNEL=="sdb", TAG+="hoge"
21255d
+KERNEL=="sda", TAG+="aaa" \\
21255d
+KERNEL=="sdb", TAG+="bbb"
21255d
+TAGS=="foo", SYMLINK+="found"
21255d
+TAGS=="aaa", SYMLINK+="bad"
21255d
 EOF
21255d
         },
21255d
 );