diff --git a/Changelog.txt b/Changelog.txt index 1ad56a171..dbf337826 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -4,16 +4,19 @@ * NEW: * Added new subtitle format - thx Oli * IMPROVED: + * Updated Finnish translation - thx Teijo S. * Some updates for format "sif" + * Some updates for format "Cavena 890" - thx Elad * FIXED: * Fix updating of main list view after "Remove text for HI" + "Apply" - thx Henry * Spell check "change" / "change all" issue regarding brackets/dash - thx jc - * Fixed issue where current frame rate was lost when loading new sub - thx elad + * Fixed issue where current frame rate was lost when loading new sub - thx Elad * Remove bad chars when saving TTML 1.0 * Minor fix for "Toggle dashed" inside italic tag - thx Bryan * Sometimes Dutch was detected as English * Fixed bug regarding double line italic in format "iTunes Timed Text" - thx Ajax - * Restore video position after "Reopen" - thx vmb + * Set video position after "Reopen" - thx vmb + * Fix for border size in vobsub export via cmd line - thx S_E_New * + Many minor fixes from ivandrofly and xylographe diff --git a/src/Test/Logic/UtilitiesTest.cs b/src/Test/Logic/UtilitiesTest.cs index 344057d49..6ede7eea3 100644 --- a/src/Test/Logic/UtilitiesTest.cs +++ b/src/Test/Logic/UtilitiesTest.cs @@ -27,7 +27,6 @@ namespace Test.Logic } [TestMethod] - [DeploymentItem("SubtitleEdit.exe")] public void AutoBreakLine3() { string s1 = "- We're gonna lose him." + Environment.NewLine + "- He's left him four signals in the last week."; @@ -36,7 +35,6 @@ namespace Test.Logic } [TestMethod] - [DeploymentItem("SubtitleEdit.exe")] public void AutoBreakLine4() { Configuration.Settings.General.SubtitleLineMaximumLength = 43; @@ -47,18 +45,16 @@ namespace Test.Logic } [TestMethod] - [DeploymentItem("SubtitleEdit.exe")] public void AutoBreakLine5() { Configuration.Settings.General.SubtitleLineMaximumLength = 43; const string s1 = "30 years ago I'd found The Book of the Dead."; var s2 = Utilities.AutoBreakLine(s1); - var Expected = "30 years ago I'd found" + Environment.NewLine + "The Book of the Dead."; - Assert.AreEqual(Expected, s2); + var expected = "30 years ago I'd found" + Environment.NewLine + "The Book of the Dead."; + Assert.AreEqual(expected, s2); } [TestMethod] - [DeploymentItem("SubtitleEdit.exe")] public void AutoBreakLine5DoNoBreakAtPeriod() { Configuration.Settings.General.SubtitleLineMaximumLength = 43; @@ -69,7 +65,6 @@ namespace Test.Logic } [TestMethod] - [DeploymentItem("SubtitleEdit.exe")] public void AutoBreakLineDoNotBreakAfterDashDash() { Configuration.Settings.General.SubtitleLineMaximumLength = 43; @@ -79,7 +74,6 @@ namespace Test.Logic } [TestMethod] - [DeploymentItem("SubtitleEdit.exe")] public void AutoBreakLineDialog1() { const string s1 = "- Qu'est ce qui se passe ? - Je veux voir ce qu'ils veulent ĂȘtre."; @@ -88,7 +82,6 @@ namespace Test.Logic } [TestMethod] - [DeploymentItem("SubtitleEdit.exe")] public void AutoBreakLineDialog2() { const string s1 = "- Je veux voir ce qu'ils veulent ĂȘtre. - Qu'est ce qui se passe ?"; @@ -97,7 +90,6 @@ namespace Test.Logic } [TestMethod] - [DeploymentItem("SubtitleEdit.exe")] public void FixInvalidItalicTags2() { const string s1 = "Gledaj prema kameri i rici zdravo!"; @@ -106,7 +98,6 @@ namespace Test.Logic } [TestMethod] - [DeploymentItem("SubtitleEdit.exe")] public void FixInvalidItalicTags3() { string s1 = "Line 1." + Environment.NewLine + "Line 2."; @@ -115,7 +106,6 @@ namespace Test.Logic } [TestMethod] - [DeploymentItem("SubtitleEdit.exe")] public void FixInvalidItalicTags4() { string s1 = "It is a telegram," + Environment.NewLine + "it is ordering an advance,"; @@ -124,7 +114,6 @@ namespace Test.Logic } [TestMethod] - [DeploymentItem("SubtitleEdit.exe")] public void FixInvalidItalicTags5() { string s1 = "- It is a telegram?" + Environment.NewLine + "- It is."; @@ -133,7 +122,6 @@ namespace Test.Logic } [TestMethod] - [DeploymentItem("SubtitleEdit.exe")] public void FixInvalidItalicTags6() { string s1 = "- Text1!" + Environment.NewLine + "- Text2."; @@ -142,7 +130,6 @@ namespace Test.Logic } [TestMethod] - [DeploymentItem("SubtitleEdit.exe")] public void FixInvalidItalicTags7() { string s1 = "- You think they're they gone?" + Environment.NewLine + "- That can't be."; @@ -151,7 +138,6 @@ namespace Test.Logic } [TestMethod] - [DeploymentItem("SubtitleEdit.exe")] public void FixInvalidItalicTags8() { string s1 = "- You think they're they gone?" + Environment.NewLine + "- That can't be."; @@ -160,7 +146,6 @@ namespace Test.Logic } [TestMethod] - [DeploymentItem("SubtitleEdit.exe")] public void FixInvalidItalicTags9() { const string s1 = "FALCONE: I didn't think\r\nit was going to be you,"; @@ -169,7 +154,6 @@ namespace Test.Logic } [TestMethod] - [DeploymentItem("SubtitleEdit.exe")] public void FixInvalidItalicTags10() { const string s1 = "< I>Hallo!"; @@ -178,7 +162,6 @@ namespace Test.Logic } [TestMethod] - [DeploymentItem("SubtitleEdit.exe")] public void FixInvalidItalicTags11() { const string s1 = "< I >Hallo!< /I>"; @@ -187,7 +170,6 @@ namespace Test.Logic } [TestMethod] - [DeploymentItem("SubtitleEdit.exe")] public void FixInvalidItalicTags12() { const string s1 = "< I >Hallo!"; @@ -196,7 +178,6 @@ namespace Test.Logic } [TestMethod] - [DeploymentItem("SubtitleEdit.exe")] public void FixUnneededSpacesDoubleSpace1() { const string s1 = "This is a test"; @@ -205,7 +186,6 @@ namespace Test.Logic } [TestMethod] - [DeploymentItem("SubtitleEdit.exe")] public void FixUnneededSpacesDoubleSpace2() { const string s1 = "This is a test "; @@ -214,7 +194,6 @@ namespace Test.Logic } [TestMethod] - [DeploymentItem("SubtitleEdit.exe")] public void FixUnneededSpacesItalics1() { const string s1 = " This is a test"; @@ -223,7 +202,6 @@ namespace Test.Logic } [TestMethod] - [DeploymentItem("SubtitleEdit.exe")] public void FixUnneededSpacesItalics2() { const string s1 = "This is a test "; @@ -232,7 +210,6 @@ namespace Test.Logic } [TestMethod] - [DeploymentItem("SubtitleEdit.exe")] public void FixUnneededSpacesHyphen1() { const string s1 = "This is a low- budget job"; @@ -241,7 +218,6 @@ namespace Test.Logic } [TestMethod] - [DeploymentItem("SubtitleEdit.exe")] public void FixUnneededSpacesHyphen2() { const string s1 = "This is a low- budget job"; @@ -250,7 +226,6 @@ namespace Test.Logic } [TestMethod] - [DeploymentItem("SubtitleEdit.exe")] public void FixUnneededSpacesHyphenDoNotChange1() { const string s1 = "This is it - and he likes it!"; @@ -259,7 +234,6 @@ namespace Test.Logic } [TestMethod] - [DeploymentItem("SubtitleEdit.exe")] public void FixUnneededSpacesHyphenDoNotChange2() { const string s1 = "What are your long- and altitude stats?"; @@ -268,7 +242,6 @@ namespace Test.Logic } [TestMethod] - [DeploymentItem("SubtitleEdit.exe")] public void FixUnneededSpacesHyphenDoNotChange3() { const string s1 = "Did you buy that first- or second-handed?"; @@ -277,7 +250,6 @@ namespace Test.Logic } [TestMethod] - [DeploymentItem("SubtitleEdit.exe")] public void FixUnneededSpacesHyphenDoNotChangeDutch1() { const string s1 = "Wat zijn je voor- en familienaam?"; @@ -286,7 +258,6 @@ namespace Test.Logic } [TestMethod] - [DeploymentItem("SubtitleEdit.exe")] public void FixUnneededSpacesHyphenDoNotChangeDutch2() { const string s1 = "Was het in het voor- of najaar?"; @@ -295,7 +266,6 @@ namespace Test.Logic } [TestMethod] - [DeploymentItem("SubtitleEdit.exe")] public void FixUnneededSpacesDialogDotDotDotLine1() { string s = Utilities.RemoveUnneededSpaces("- ... Careful", "en"); @@ -303,7 +273,6 @@ namespace Test.Logic } [TestMethod] - [DeploymentItem("SubtitleEdit.exe")] public void FixUnneededSpacesDialogDotDotDotLine2() { string s = Utilities.RemoveUnneededSpaces("- Hi!" + Environment.NewLine + "- ... Careful", "en"); @@ -311,7 +280,6 @@ namespace Test.Logic } [TestMethod] - [DeploymentItem("SubtitleEdit.exe")] public void FixUnneededSpacesFontTag1() { string s = Utilities.RemoveUnneededSpaces(" (PEOPLE SPEAKING INDISTINCTLY) ", "en"); @@ -319,7 +287,6 @@ namespace Test.Logic } [TestMethod] - [DeploymentItem("SubtitleEdit.exe")] public void FixUnneededSpacesFontTag2() { string s = Utilities.RemoveUnneededSpaces("Foobar\r\n (PEOPLE SPEAKING INDISTINCTLY) ", "en"); @@ -327,7 +294,6 @@ namespace Test.Logic } [TestMethod] - [DeploymentItem("SubtitleEdit.exe")] public void FixUnneededSpacesFontTag3() { string s = Utilities.RemoveUnneededSpaces("- Foobar! \r\n (PEOPLE SPEAKING INDISTINCTLY) ", "en"); @@ -335,7 +301,6 @@ namespace Test.Logic } [TestMethod] - [DeploymentItem("SubtitleEdit.exe")] public void CountTagInTextStringOneLetterString() { int count = Utilities.CountTagInText("HHH", "H"); @@ -343,7 +308,6 @@ namespace Test.Logic } [TestMethod] - [DeploymentItem("SubtitleEdit.exe")] public void CountTagInTextStringNotThere() { int count = Utilities.CountTagInText("HHH", "B"); @@ -351,7 +315,6 @@ namespace Test.Logic } [TestMethod] - [DeploymentItem("SubtitleEdit.exe")] public void CountTagInTextCharNormal() { int count = Utilities.CountTagInText("HHH", 'H'); @@ -359,7 +322,6 @@ namespace Test.Logic } [TestMethod] - [DeploymentItem("SubtitleEdit.exe")] public void CountTagInTextCharNotThere() { int count = Utilities.CountTagInText("HHH", 'B'); @@ -367,7 +329,6 @@ namespace Test.Logic } [TestMethod] - [DeploymentItem("SubtitleEdit.exe")] public void FixHyphensAddTest() { string test1 = "- Foobar." + Environment.NewLine + "Foobar."; @@ -388,7 +349,6 @@ namespace Test.Logic } [TestMethod] - [DeploymentItem("SubtitleEdit.exe")] public void FixHyphensAddTestAssTag() { string test1 = "{\\an5}- At least I was going back to Hawaii." + Environment.NewLine + "Woody."; @@ -402,7 +362,6 @@ namespace Test.Logic } [TestMethod] - [DeploymentItem("SubtitleEdit.exe")] public void FixHyphensAddTestItalic() { string test1 = "- At least I was going back to Hawaii." + Environment.NewLine + "Woody."; @@ -416,7 +375,6 @@ namespace Test.Logic } [TestMethod] - [DeploymentItem("SubtitleEdit.exe")] public void RemoveLineBreaks1() { string result = Utilities.RemoveLineBreaks("Hey" + Environment.NewLine + "you!"); @@ -424,7 +382,6 @@ namespace Test.Logic } [TestMethod] - [DeploymentItem("SubtitleEdit.exe")] public void RemoveLineBreaks2() { string result = Utilities.RemoveLineBreaks("Foobar " + Environment.NewLine + " foobar."); @@ -432,7 +389,6 @@ namespace Test.Logic } [TestMethod] - [DeploymentItem("SubtitleEdit.exe")] public void RemoveLineBreaks3() { string result = Utilities.RemoveLineBreaks("Foobar " + Environment.NewLine + "foobar."); @@ -440,7 +396,6 @@ namespace Test.Logic } [TestMethod] - [DeploymentItem("SubtitleEdit.exe")] public void RemoveLineBreaks4() { string result = Utilities.RemoveLineBreaks("Hey" + Environment.NewLine + "you!"); @@ -448,12 +403,41 @@ namespace Test.Logic } [TestMethod] - [DeploymentItem("SubtitleEdit.exe")] public void RemoveLineBreaks5() { string result = Utilities.RemoveLineBreaks("Foobar" + Environment.NewLine + ""); Assert.AreEqual(result, "Foobar"); } + [TestMethod] + public void IsValidRegexOk1() + { + Assert.IsTrue(Utilities.IsValidRegex(@"^(?![\s\S])")); + } + + [TestMethod] + public void IsValidRegexOk2() + { + Assert.IsTrue(Utilities.IsValidRegex(@"\d+")); + } + + [TestMethod] + public void IsValidRegexBad1() + { + Assert.IsFalse(Utilities.IsValidRegex(@"[\s\S(\()()(()\)")); + } + + [TestMethod] + public void ReverseNumbers1() + { + Assert.AreEqual(Utilities.ReverseNumbers("Hallo 009"), "Hallo 900"); + } + + [TestMethod] + public void ReverseNumbers2() + { + Assert.AreEqual(Utilities.ReverseNumbers("Hallo 009 001 Bye"), "Hallo 900 100 Bye"); + } + } }