diff --git a/src/Renci.SshNet.Tests/Classes/RemotePathDoubleQuoteTransformationTest.cs b/src/Renci.SshNet.Tests/Classes/RemotePathDoubleQuoteTransformationTest.cs index a0428f20..dd7c3a32 100644 --- a/src/Renci.SshNet.Tests/Classes/RemotePathDoubleQuoteTransformationTest.cs +++ b/src/Renci.SshNet.Tests/Classes/RemotePathDoubleQuoteTransformationTest.cs @@ -446,7 +446,7 @@ namespace Renci.SshNet.Tests.Classes } [TestMethod] - public void ExclamationMark_Embedded() + public void ExclamationMark_Embedded_Single() { const string path = "/var/garbage!/temp"; @@ -455,6 +455,16 @@ namespace Renci.SshNet.Tests.Classes Assert.AreEqual("\"/var/garbage!/temp\"", actual); } + [TestMethod] + public void ExclamationMark_Embedded_Sequence() + { + const string path = "/var/garbage!!/temp"; + + var actual = _transformation.Transform(path); + + Assert.AreEqual("\"/var/garbage!!/temp\"", actual); + } + [TestMethod] public void ExclamationMark_Leading() { @@ -886,7 +896,7 @@ namespace Renci.SshNet.Tests.Classes } [TestMethod] - public void SingleQuote_Embedded() + public void SingleQuote_Embedded_Single() { const string path = "Rain'Storm"; @@ -895,6 +905,16 @@ namespace Renci.SshNet.Tests.Classes Assert.AreEqual("\"Rain'Storm\"", actual); } + [TestMethod] + public void SingleQuote_Embedded_Sequence() + { + const string path = "Rain''Storm"; + + var actual = _transformation.Transform(path); + + Assert.AreEqual("\"Rain''Storm\"", actual); + } + [TestMethod] public void SingleQuote_Leading() { @@ -925,6 +945,46 @@ namespace Renci.SshNet.Tests.Classes Assert.AreEqual("\"Time'\"", actual); } + [TestMethod] + public void SingleQuoteAndExclamationMark_Embedded() + { + const string path = "Rain'!Storm"; + + var actual = _transformation.Transform(path); + + Assert.AreEqual("\"Rain'!Storm\"", actual); + } + + [TestMethod] + public void SingleQuoteAndExclamationMark_Leading() + { + const string path = "'!Rain"; + + var actual = _transformation.Transform(path); + + Assert.AreEqual("\"'!Rain\"", actual); + } + + [TestMethod] + public void SingleQuoteAndExclamationMark_LeadingAndTrailing() + { + const string path = "'!Rain'!"; + + var actual = _transformation.Transform(path); + + Assert.AreEqual("\"'!Rain'!\"", actual); + } + + [TestMethod] + public void SingleQuoteAndExclamationMark_Trailing() + { + const string path = "Rain'!"; + + var actual = _transformation.Transform(path); + + Assert.AreEqual("\"Rain'!\"", actual); + } + [TestMethod] public void Space_Embedded() { diff --git a/src/Renci.SshNet.Tests/Classes/RemotePathShellQuoteTransformationTest.cs b/src/Renci.SshNet.Tests/Classes/RemotePathShellQuoteTransformationTest.cs index 311d4b33..a20fc518 100644 --- a/src/Renci.SshNet.Tests/Classes/RemotePathShellQuoteTransformationTest.cs +++ b/src/Renci.SshNet.Tests/Classes/RemotePathShellQuoteTransformationTest.cs @@ -446,7 +446,7 @@ namespace Renci.SshNet.Tests.Classes } [TestMethod] - public void ExclamationMark_Embedded() + public void ExclamationMark_Embedded_Single() { const string path = "/var/garbage!/temp"; @@ -455,6 +455,16 @@ namespace Renci.SshNet.Tests.Classes Assert.AreEqual("'/var/garbage'\\!'/temp'", actual); } + [TestMethod] + public void ExclamationMark_Embedded_Sequence() + { + const string path = "/var/garbage!!/temp"; + + var actual = _transformation.Transform(path); + + Assert.AreEqual("'/var/garbage'\\!\\!'/temp'", actual); + } + [TestMethod] public void ExclamationMark_Leading() { @@ -886,7 +896,7 @@ namespace Renci.SshNet.Tests.Classes } [TestMethod] - public void SingleQuote_Embedded() + public void SingleQuote_Embedded_Single() { const string path = "Rain'Storm"; @@ -895,6 +905,16 @@ namespace Renci.SshNet.Tests.Classes Assert.AreEqual("'Rain'\"'\"'Storm'", actual); } + [TestMethod] + public void SingleQuote_Embedded_Sequence() + { + const string path = "Rain''Storm"; + + var actual = _transformation.Transform(path); + + Assert.AreEqual("'Rain'\"''\"'Storm'", actual); + } + [TestMethod] public void SingleQuote_Leading() { @@ -925,6 +945,46 @@ namespace Renci.SshNet.Tests.Classes Assert.AreEqual("'Time'\"'\"", actual); } + [TestMethod] + public void SingleQuoteAndExclamationMark_Embedded() + { + const string path = "Rain'!Storm"; + + var actual = _transformation.Transform(path); + + Assert.AreEqual("'Rain'\"'\"\\!'Storm'", actual); + } + + [TestMethod] + public void SingleQuoteAndExclamationMark_Leading() + { + const string path = "'!Rain"; + + var actual = _transformation.Transform(path); + + Assert.AreEqual("\"'\"\\!'Rain'", actual); + } + + [TestMethod] + public void SingleQuoteAndExclamationMark_LeadingAndTrailing() + { + const string path = "'!Rain'!"; + + var actual = _transformation.Transform(path); + + Assert.AreEqual("\"'\"\\!'Rain'\"'\"\\!", actual); + } + + [TestMethod] + public void SingleQuoteAndExclamationMark_Trailing() + { + const string path = "Rain'!"; + + var actual = _transformation.Transform(path); + + Assert.AreEqual("'Rain'\"'\"\\!", actual); + } + [TestMethod] public void Space_Embedded() {