Skip to content

Commit

Permalink
[tests/link sdk] Adjust the LinkSdkRegressionTest.SpecialFolder test …
Browse files Browse the repository at this point in the history
…according to the new version of .NET 6.
  • Loading branch information
rolfbjarne committed Jan 13, 2021
1 parent 686d93c commit 88c1a34
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion tests/linker/ios/link sdk/LinkSdkRegressionTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -902,7 +902,13 @@ public void SpecialFolder ()
Assert.That (path, Is.EqualTo ("/usr/share"), "path - CommonApplicationData");

// and the simulator is more lax
#if !NET // https:/dotnet/runtime/issues/41383
#if NET
// ProgramFiles is different on .NET: https:/dotnet/runtime/pull/41959#discussion_r485069017
path = TestFolder (Environment.SpecialFolder.ProgramFiles, readOnly: device, exists: false);
var applicationsPath = NSSearchPath.GetDirectories (NSSearchPathDirectory.ApplicationDirectory, NSSearchPathDomain.All, true).FirstOrDefault ();
Assert.That (path, Is.EqualTo (applicationsPath), "path - ProgramFiles");
#else

path = TestFolder (Environment.SpecialFolder.ProgramFiles, readOnly: device);
Assert.That (path, Is.EqualTo ("/Applications"), "path - ProgramFiles");
#endif
Expand Down Expand Up @@ -935,7 +941,11 @@ public void SpecialFolder ()
path = TestFolder (Environment.SpecialFolder.MyDocuments);
Assert.That (path, Is.EqualTo (docs), "path - MyDocuments");

#if NET
path = TestFolder (Environment.SpecialFolder.ApplicationData, exists: false);
#else
path = TestFolder (Environment.SpecialFolder.ApplicationData);
#endif
Assert.That (path, Is.EqualTo (docs + "/.config"), "path - ApplicationData");

path = TestFolder (Environment.SpecialFolder.LocalApplicationData);
Expand Down

0 comments on commit 88c1a34

Please sign in to comment.