Handle a file ref, with backslashes, in a .resx, on a non-windows system
[mono.git] / mcs / class / System.Windows.Forms / Test / System.Resources / ResXFileRefTest.cs
index b0d1c924b86d4efcb659cac59529d26c2e06ffcf..83aef31a3b5232a2375b26764ee00e7a8ac4a1e7 100644 (file)
@@ -229,6 +229,26 @@ namespace MonoTests.System.Resources
                        }
                }
 
+               [Test]
+               public void ConvertFrom_Type_String_FilePathWithBackslashes ()
+               {
+                       if (Path.DirectorySeparatorChar == '\\')
+                               // non-windows test
+                               return;
+
+                       string fileContents = "foobar";
+                       string fileName = "foo.txt";
+                       string filePath = Path.Combine (_tempDirectory, fileName);
+                       File.WriteAllText (filePath, fileContents);
+
+                       filePath = _tempDirectory + "\\.\\" + filename;
+
+                       string fileRef = filePath + ";" + typeof (string).AssemblyQualifiedName;
+                       string result = _converter.ConvertFrom (fileRef) as string;
+                       Assert.IsNotNull (result, "#A1");
+                       Assert.AreEqual (result, fileContents, "#A2");
+               }
+
                [Test]
                public void ConvertFrom_Type_StreamReader ()
                {