Merge branch 'visual_style_manager' into v2_config_manager

This commit is contained in:
Tig Kindel
2023-02-21 13:58:58 +13:00
6 changed files with 391 additions and 2 deletions

View File

@@ -69,6 +69,9 @@ namespace UICatalog.Tests {
scenario.Init (Colors.Base);
scenario.Setup ();
scenario.Run ();
scenario.Dispose();
Application.Shutdown ();
#if DEBUG_IDISPOSABLE
foreach (var inst in Responder.Instances) {
@@ -136,6 +139,8 @@ namespace UICatalog.Tests {
// Using variable in the left side of Assert.Equal/NotEqual give error. Must be used literals values.
//Assert.Equal (stackSize, iterations);
generic.Dispose();
// Shutdown must be called to safely clean up Application if Init has been called
Application.Shutdown ();

View File

@@ -1,5 +1,6 @@
using NStack;
using System;
using Terminal.Gui.Graphs;
using Xunit;
using Xunit.Abstractions;
//using GraphViewTests = Terminal.Gui.Views.GraphViewTests;
@@ -4489,5 +4490,31 @@ At 0,0
A text with some long width
A text witith two lines. ", output);
}
[Fact, AutoInitShutdown]
public void Test_Nested_Views_With_Height_Equal_To_One ()
{
var v = new View () { Width = 11, Height = 3, ColorScheme = new ColorScheme () };
var top = new View () { Width = Dim.Fill (), Height = 1 };
var bottom = new View () { Width = Dim.Fill (), Height = 1, Y = 2 };
top.Add (new Label ("111"));
v.Add (top);
v.Add (new LineView (Orientation.Horizontal) { Y = 1 });
bottom.Add (new Label ("222"));
v.Add (bottom);
v.LayoutSubviews ();
v.Redraw (v.Bounds);
string looksLike =
@"
111
───────────
222";
TestHelpers.AssertDriverContentsAre (looksLike, output);
}
}
}