Skip to content

Commit

Permalink
Removed unneeded CM stuff from testhelpers
Browse files Browse the repository at this point in the history
  • Loading branch information
tig committed Sep 26, 2024
1 parent 06bcefe commit a708648
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
2 changes: 2 additions & 0 deletions Terminal.Gui/Application/Application.cs
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,8 @@ internal static void ResetState (bool ignoreDisposed = false)
Top = null;
_cachedRunStateToplevel = null;

Popover = null;

// MainLoop stuff
MainLoop?.Dispose ();
MainLoop = null;
Expand Down
24 changes: 12 additions & 12 deletions UnitTests/TestHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@ public override void After (MethodInfo methodUnderTest)
}
}

// Force the use of the default config file
Locations = ConfigLocations.DefaultOnly;
Reset ();
//// Force the use of the default config file
//Locations = ConfigLocations.DefaultOnly;
//Reset ();

// Enable subsequent tests that call Init to get all config files (the default).
Locations = ConfigLocations.All;
Expand All @@ -118,7 +118,7 @@ public override void Before (MethodInfo methodUnderTest)
{
// Force the use of the default config file
Locations = ConfigLocations.DefaultOnly;
Reset ();
//Reset (); // Init will do this.

#if DEBUG_IDISPOSABLE

Expand Down Expand Up @@ -157,10 +157,10 @@ public override void After (MethodInfo methodUnderTest)
{
Debug.WriteLine ($"After: {methodUnderTest.Name}");
base.After (methodUnderTest);

// Reset the to default All
Locations = ConfigLocations.All;
Reset ();
//Reset ();

#if DEBUG_IDISPOSABLE
Assert.Empty (Responder.Instances);
Expand Down Expand Up @@ -209,7 +209,7 @@ public override void After (MethodInfo methodUnderTest)

// Reset the to default All
Locations = ConfigLocations.All;
Reset ();
//Reset ();
}

public override void Before (MethodInfo methodUnderTest)
Expand Down Expand Up @@ -731,11 +731,11 @@ private static string ReplaceNewLinesToPlatformSpecific (string toReplace)
string replaced = toReplace;

replaced = Environment.NewLine.Length switch
{
2 when !replaced.Contains ("\r\n") => replaced.Replace ("\n", Environment.NewLine),
1 => replaced.Replace ("\r\n", Environment.NewLine),
var _ => replaced
};
{
2 when !replaced.Contains ("\r\n") => replaced.Replace ("\n", Environment.NewLine),
1 => replaced.Replace ("\r\n", Environment.NewLine),
var _ => replaced
};

return replaced;
}
Expand Down

0 comments on commit a708648

Please sign in to comment.