diff options
Diffstat (limited to 'WebKitTools/Scripts/webkitperl/VCSUtils_unittest/parseSvnProperty.pl')
-rw-r--r-- | WebKitTools/Scripts/webkitperl/VCSUtils_unittest/parseSvnProperty.pl | 224 |
1 files changed, 224 insertions, 0 deletions
diff --git a/WebKitTools/Scripts/webkitperl/VCSUtils_unittest/parseSvnProperty.pl b/WebKitTools/Scripts/webkitperl/VCSUtils_unittest/parseSvnProperty.pl index cff7c2e..bdca1ab 100644 --- a/WebKitTools/Scripts/webkitperl/VCSUtils_unittest/parseSvnProperty.pl +++ b/WebKitTools/Scripts/webkitperl/VCSUtils_unittest/parseSvnProperty.pl @@ -131,6 +131,25 @@ END }, { # New test + diffName => "add svn:executable, followed by empty line and start of next diff using Windows line endings", + inputText => toWindowsLineEndings(<<'END', +Added: svn:executable + + * + +Index: Makefile.shared +END +), + expectedReturn => [ +{ + name => "svn:executable", + propertyChangeDelta => 1, + value => "*", +}, +"\r\n"], + expectedNextLine => "Index: Makefile.shared\r\n", +}, +{ + # New test diffName => "add svn:executable, followed by empty line and start of next property diff", inputText => <<'END', Added: svn:executable @@ -149,6 +168,25 @@ END }, { # New test + diffName => "add svn:executable, followed by empty line and start of next property diff using Windows line endings", + inputText => toWindowsLineEndings(<<'END', +Added: svn:executable + + * + +Property changes on: Makefile.shared +END +), + expectedReturn => [ +{ + name => "svn:executable", + propertyChangeDelta => 1, + value => "*", +}, +"\r\n"], + expectedNextLine => "Property changes on: Makefile.shared\r\n", +}, +{ + # New test diffName => "multi-line '+' change, followed by empty line and start of next diff", inputText => <<'END', Name: documentation @@ -169,6 +207,27 @@ END }, { # New test + diffName => "multi-line '+' change, followed by empty line and start of next diff using Windows line endings", + inputText => toWindowsLineEndings(<<'END', +Name: documentation + + A +long sentence that spans +multiple lines. + +Index: Makefile.shared +END +), + expectedReturn => [ +{ + name => "documentation", + propertyChangeDelta => 1, + value => "A\r\nlong sentence that spans\r\nmultiple lines.", +}, +"\r\n"], + expectedNextLine => "Index: Makefile.shared\r\n", +}, +{ + # New test diffName => "multi-line '+' change, followed by empty line and start of next property diff", inputText => <<'END', Name: documentation @@ -187,6 +246,27 @@ END "\n"], expectedNextLine => "Property changes on: Makefile.shared\n", }, +{ + # New test + diffName => "multi-line '+' change, followed by empty line and start of next property diff using Windows line endings", + inputText => toWindowsLineEndings(<<'END', +Name: documentation + + A +long sentence that spans +multiple lines. + +Property changes on: Makefile.shared +END +), + expectedReturn => [ +{ + name => "documentation", + propertyChangeDelta => 1, + value => "A\r\nlong sentence that spans\r\nmultiple lines.", +}, +"\r\n"], + expectedNextLine => "Property changes on: Makefile.shared\r\n", +}, #### # Property value followed by empty line and start of binary patch ## @@ -210,6 +290,25 @@ END }, { # New test + diffName => "add svn:executable, followed by empty line and start of binary patch using Windows line endings", + inputText => toWindowsLineEndings(<<'END', +Added: svn:executable + + * + +Q1dTBx0AAAB42itg4GlgYJjGwMDDyODMxMDw34GBgQEAJPQDJA== +END +), + expectedReturn => [ +{ + name => "svn:executable", + propertyChangeDelta => 1, + value => "*", +}, +"\r\n"], + expectedNextLine => "Q1dTBx0AAAB42itg4GlgYJjGwMDDyODMxMDw34GBgQEAJPQDJA==\r\n", +}, +{ + # New test diffName => "multi-line '+' change, followed by empty line and start of binary patch", inputText => <<'END', Name: documentation @@ -230,6 +329,27 @@ END }, { # New test + diffName => "multi-line '+' change, followed by empty line and start of binary patch using Windows line endings", + inputText => toWindowsLineEndings(<<'END', +Name: documentation + + A +long sentence that spans +multiple lines. + +Q1dTBx0AAAB42itg4GlgYJjGwMDDyODMxMDw34GBgQEAJPQDJA== +END +), + expectedReturn => [ +{ + name => "documentation", + propertyChangeDelta => 1, + value => "A\r\nlong sentence that spans\r\nmultiple lines.", +}, +"\r\n"], + expectedNextLine => "Q1dTBx0AAAB42itg4GlgYJjGwMDDyODMxMDw34GBgQEAJPQDJA==\r\n", +}, +{ + # New test diffName => "multi-line '-' change, followed by multi-line '+' change, empty line, and start of binary patch", inputText => <<'END', Modified: documentation @@ -251,6 +371,30 @@ END "\n"], expectedNextLine => "Q1dTBx0AAAB42itg4GlgYJjGwMDDyODMxMDw34GBgQEAJPQDJA==\n", }, +{ + # New test + diffName => "multi-line '-' change, followed by multi-line '+' change, empty line, and start of binary patch using Windows line endings", + inputText => toWindowsLineEndings(<<'END', +Modified: documentation + - A +long sentence that spans +multiple lines. + + Another +long sentence that spans +multiple lines. + +Q1dTBx0AAAB42itg4GlgYJjGwMDDyODMxMDw34GBgQEAJPQDJA== +END +), + expectedReturn => [ +{ + name => "documentation", + propertyChangeDelta => 1, + value => "Another\r\nlong sentence that spans\r\nmultiple lines.", +}, +"\r\n"], + expectedNextLine => "Q1dTBx0AAAB42itg4GlgYJjGwMDDyODMxMDw34GBgQEAJPQDJA==\r\n", +}, #### # Successive properties ## @@ -340,6 +484,24 @@ END }, { # New test + diffName => "single-line '+' with trailing new line using Windows line endings", + inputText => toWindowsLineEndings(<<'END', +Added: documentation + + A sentence. + +END +), + expectedReturn => [ +{ + name => "documentation", + propertyChangeDelta => 1, + value => "A sentence.", +}, +"\r\n"], + expectedNextLine => undef, +}, +{ + # New test diffName => "single-line '+' with trailing new line, followed by empty line and start of binary patch", inputText => <<'END', Added: documentation @@ -359,6 +521,26 @@ END }, { # New test + diffName => "single-line '+' with trailing new line, followed by empty line and start of binary patch using Windows line endings", + inputText => toWindowsLineEndings(<<'END', +Added: documentation + + A sentence. + + +Q1dTBx0AAAB42itg4GlgYJjGwMDDyODMxMDw34GBgQEAJPQDJA== +END +), + expectedReturn => [ +{ + name => "documentation", + propertyChangeDelta => 1, + value => "A sentence.", +}, +"\r\n"], + expectedNextLine => "\r\n", +}, +{ + # New test diffName => "single-line '-' change with trailing new line, and single-line '+' change", inputText => <<'END', Modified: documentation @@ -377,6 +559,25 @@ END }, { # New test + diffName => "single-line '-' change with trailing new line, and single-line '+' change using Windows line endings", + inputText => toWindowsLineEndings(<<'END', +Modified: documentation + - A long sentence. + + + A sentence. +END +), + expectedReturn => [ +{ + name => "documentation", + propertyChangeDelta => -1, # Since we only interpret the '-' property. + value => "A long sentence.", +}, +"\r\n"], + expectedNextLine => " + A sentence.\r\n", +}, +{ + # New test diffName => "multi-line '-' change with trailing new line, and multi-line '+' change", inputText => <<'END', Modified: documentation @@ -397,6 +598,29 @@ END "\n"], expectedNextLine => " + Another\n", }, +{ + # New test + diffName => "multi-line '-' change with trailing new line, and multi-line '+' change using Windows line endings", + inputText => toWindowsLineEndings(<<'END', +Modified: documentation + - A +long sentence that spans +multiple lines. + + + Another +long sentence that spans +multiple lines. +END +), + expectedReturn => [ +{ + name => "documentation", + propertyChangeDelta => -1, # Since we only interpret the '-' property. + value => "A\r\nlong sentence that spans\r\nmultiple lines.", +}, +"\r\n"], + expectedNextLine => " + Another\r\n", +}, ); my $testCasesCount = @testCaseHashRefs; |