From e37a5d90b0c624b95f8d0c3400288fec60417ec4 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Tue, 19 Feb 2019 09:21:42 +0900 Subject: [PATCH 1/2] test-udev: use proper semantics for too long line with continuation Follow-up for 1e797cf596df50a6bdd8cbf8e9b2467a3a934171. --- test/udev-test.pl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/udev-test.pl b/test/udev-test.pl index 3a50694fa9..58b5dc85e1 100755 --- a/test/udev-test.pl +++ b/test/udev-test.pl @@ -39,10 +39,11 @@ for (my $i = 1; $i <= 10000; ++$i) { $rules_10k_tags .= 'KERNEL=="sda", TAG+="test' . $i . "\"\n"; } -my $rules_10k_tags_continuation = ""; -for (my $i = 1; $i <= 10000; ++$i) { - $rules_10k_tags_continuation .= 'KERNEL=="sda", TAG+="test' . $i . "\"\\\n"; +my $rules_10k_tags_continuation = "KERNEL==\"sda\", \\\n"; +for (my $i = 1; $i < 10000; ++$i) { + $rules_10k_tags_continuation .= 'TAG+="test' . $i . "\",\\\n"; } +$rules_10k_tags_continuation .= "TAG+=\"test10000\"\\n"; my @tests = ( { From d35976c670b0e5c2d4081b781e5af88c0689ff00 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Tue, 19 Feb 2019 09:22:45 +0900 Subject: [PATCH 2/2] test-udev: add more tests for line continuations and comments --- test/udev-test.pl | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/test/udev-test.pl b/test/udev-test.pl index 58b5dc85e1..a5e1f8cda3 100755 --- a/test/udev-test.pl +++ b/test/udev-test.pl @@ -1453,13 +1453,21 @@ TAGS=="test1", TAGS=="test500", TAGS=="test1234", TAGS=="test9999", TAGS=="test1 EOF }, { - desc => "don't crash with lots of tags with continuation", + desc => "continuations", 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 => $rules_10k_tags_continuation . <