Skip to content

Commit ebb7404

Browse files
authored
Release v2.0.0-rc.5 (#5082)
1 parent 82c9ff6 commit ebb7404

92 files changed

Lines changed: 4595 additions & 2895 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CLAUDE.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,22 @@ When in planning mode:
8989
```bash
9090
dotnet restore
9191
dotnet build --no-restore
92+
93+
# Preferred: parallelizable tests (no static state)
9294
dotnet test --project Tests/UnitTestsParallelizable --no-build
93-
dotnet test --project Tests/UnitTests --no-build
95+
96+
# Tests that require process-wide static state (Application.Init, etc.)
97+
dotnet test --project Tests/UnitTests.NonParallelizable --no-build
98+
99+
# Legacy tests — do NOT add new tests here; candidates for rewrite/deletion
100+
dotnet test --project Tests/UnitTests.Legacy --no-build
101+
102+
# Run a single test by fully-qualified name
103+
dotnet test --project Tests/UnitTestsParallelizable --no-build --filter "FullyQualifiedName~MyTestClass.MyTestMethod"
94104
```
95105

106+
See `Tests/README.md` for the full list of test projects (including `IntegrationTests`, `StressTests`, `Benchmarks`) and the static-state classification that determines where a new test belongs.
107+
96108
## Key Concepts
97109

98110
| Concept | Documentation |
@@ -118,7 +130,7 @@ dotnet test --project Tests/UnitTests --no-build
118130

119131
## Testing
120132

121-
- Prefer `UnitTestsParallelizable` over `UnitTests`
133+
- Add new tests to `UnitTestsParallelizable`; use `UnitTests.NonParallelizable` only when static state is unavoidable. Never add to `UnitTests.Legacy`.
122134
- Add comment: `// Claude - Opus 4.5`
123135
- Never decrease coverage
124136
- Avoid `Application.Init` in tests

Directory.Packages.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
<PackageVersion Include="TextMateSharp.Grammars" Version="2.0.3" />
4343
<PackageVersion Include="ReportGenerator" Version="5.5.5" />
4444
<PackageVersion Include="TestableIO.System.IO.Abstractions.TestingHelpers" Version="22.1.1" />
45-
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.4.0" />
45+
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.5.0" />
4646
<PackageVersion Include="xunit.runner.visualstudio" Version="3.1.5" />
4747
<PackageVersion Include="xunit.v3" Version="3.2.2" />
4848
<PackageVersion Include="Xunit.Combinatorial" Version="2.0.24" />

Examples/NativeAot/NativeAot.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
<ItemGroup>
1111
<ProjectReference Include="..\..\Terminal.Gui\Terminal.Gui.csproj" />
12-
<TrimmerRootAssembly Include="Terminal.Gui" />
1312
</ItemGroup>
1413

1514
</Project>

Examples/UICatalog/Resources/config.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
{
22
"$schema": "https://gui-cs.github.io/Terminal.Gui/schemas/tui-config-schema.json",
3-
"FileDialog.MaxSearchResults": 10000,
4-
"FileDialogStyle.DefaultUseColors": false,
5-
"FileDialogStyle.DefaultUseUnicodeCharacters": false,
6-
"AppSettings": {
7-
"UICatalog.StatusBar": true
8-
},
93
"Themes": [
104
{
115
"Hot Dog Stand": {

Examples/UICatalog/Scenarios/CharacterMap/CharacterMap.cs

Lines changed: 28 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#nullable enable
1+
#nullable enable
22

33
using System.Globalization;
44
using System.Text;
@@ -69,7 +69,10 @@ public override void Main ()
6969
Menus =
7070
[
7171
new MenuBarItem (Strings.menuFile,
72-
new MenuItem [] { new (Strings.cmdQuit, $"{Application.GetDefaultKey (Command.Quit)}", () => _charMap?.App?.RequestStop ()) }),
72+
new MenuItem []
73+
{
74+
new (Strings.cmdQuit, $"{Application.GetDefaultKey (Command.Quit)}", () => _charMap?.App?.RequestStop ())
75+
}),
7376
new MenuBarItem ("_Options", [CreateMenuShowWidth (), CreateMenuUnicodeCategorySelector ()])
7477
]
7578
};
@@ -135,18 +138,19 @@ public override void Main ()
135138
return;
136139
}
137140
EnumerableTableSource<UnicodeRange> table = (EnumerableTableSource<UnicodeRange>)_categoryList.Table!;
138-
string prevSelection = table.Data.ElementAt (_categoryList.SelectedRow).Category;
141+
string prevSelection = table.Data.ElementAt (_categoryList.Value?.Cursor.Y ?? 0).Category;
139142
isDescending = !isDescending;
140143

141144
_categoryList.Table = CreateCategoryTable (clickedCol.Value, isDescending);
142145

143146
table = (EnumerableTableSource<UnicodeRange>)_categoryList.Table!;
144147

145-
_categoryList.SelectedRow =
146-
table.Data.Select ((item, index) => new { item, index })
147-
.FirstOrDefault (x => x.item.Category == prevSelection)
148-
?.index
149-
?? -1;
148+
_categoryList.SetSelection (0,
149+
table.Data.Select ((item, index) => new { item, index })
150+
.FirstOrDefault (x => x.item.Category == prevSelection)
151+
?.index
152+
?? 0,
153+
false);
150154
};
151155

152156
int longestName = UnicodeRange.Ranges.Max (r => r.Category.GetColumns ());
@@ -157,12 +161,17 @@ public override void Main ()
157161

158162
_categoryList.Width = _categoryList.Style.ColumnStyles.Sum (c => c.Value.MinWidth) + 4;
159163

160-
_categoryList.SelectedCellChanged += (_, args) =>
161-
{
162-
EnumerableTableSource<UnicodeRange> table = (EnumerableTableSource<UnicodeRange>)_categoryList.Table!;
163-
_charMap.StartCodePoint = table.Data.ToArray () [args.NewRow].Start;
164-
jumpEdit.Text = $"U+{_charMap.SelectedCodePoint:x5}";
165-
};
164+
_categoryList.ValueChanged += (_, args) =>
165+
{
166+
if (args.NewValue is null)
167+
{
168+
return;
169+
}
170+
171+
EnumerableTableSource<UnicodeRange> table = (EnumerableTableSource<UnicodeRange>)_categoryList.Table!;
172+
_charMap.StartCodePoint = table.Data.ToArray () [args.NewValue.Cursor.Y].Start;
173+
jumpEdit.Text = $"U+{_charMap.SelectedCodePoint:x5}";
174+
};
166175

167176
top.Add (menu, _charMap, jumpLabel, jumpEdit, _errorLabel, _categoryList);
168177

@@ -239,11 +248,13 @@ void JumpEditOnAccept (object? sender, CommandEventArgs e)
239248

240249
EnumerableTableSource<UnicodeRange> table = (EnumerableTableSource<UnicodeRange>)_categoryList!.Table!;
241250

242-
_categoryList.SelectedRow = table.Data.Select ((item, index) => new { item, index })
251+
_categoryList.SetSelection (0,
252+
table.Data.Select ((item, index) => new { item, index })
243253
.FirstOrDefault (x => x.item.Start <= result && x.item.End >= result)
244254
?.index
245-
?? -1;
246-
_categoryList.EnsureSelectedCellIsVisible ();
255+
?? 0,
256+
false);
257+
_categoryList.EnsureCursorIsVisible ();
247258

248259
// Ensure the typed glyph is selected
249260
_charMap.SelectedCodePoint = (int)result;

0 commit comments

Comments
 (0)