Commit Graph

7865 Commits

Author SHA1 Message Date
tznind
09a3a48a2b Update class diagram 2.0.0-prealpha.1835 2025-03-21 08:18:46 +01:00
tznind
4634b35c1b Disable GenerateTestCasesForKeyPresses by default 2025-03-21 08:18:46 +01:00
tznind
15bcf0f451 Revert build props changes 2025-03-21 08:18:46 +01:00
tznind
266f03daef Xmldoc 2025-03-21 08:18:46 +01:00
tznind
bacac70588 Make all tests do both drivers 2025-03-21 08:18:46 +01:00
tznind
a9a9b5bb70 Add net ansi sequences 2025-03-21 08:18:46 +01:00
tznind
7712bc64b1 Work on ability to test both v2net and v2win 2025-03-21 08:18:46 +01:00
tznind
56d3835c37 Cleanup code 2025-03-21 08:18:46 +01:00
tznind
29355c8b63 Add automation test for selecting a submenu item 2025-03-21 08:18:46 +01:00
tznind
e94b8b1bdc Add before and after screenshots 2025-03-21 08:18:46 +01:00
tznind
407c863cb9 Add support for outputting logs from tests #3972 2025-03-21 08:18:46 +01:00
tznind
8c009de9a0 Fix test Same to Equal 2025-03-21 08:18:46 +01:00
tznind
1e40ad3bc9 Add csproj to sln 2025-03-21 08:18:46 +01:00
tznind
0b56a3d63b Remove dependency on fluent assertions and fix folder paths 2025-03-21 08:18:46 +01:00
tznind
79f289ce8f Rename to TerminalGuiFluentTesting 2025-03-21 08:18:46 +01:00
tznind
491140a39a Add timeout to tests and fix race condition to boot 2025-03-21 08:18:46 +01:00
tznind
fd465c3367 Make colon implicit in title 2025-03-21 08:18:46 +01:00
tznind
8d610a0dde Add screenshot method 2025-03-21 08:18:46 +01:00
tznind
f0bd577c98 WIP: try to get context menu to work properly in automation tests 2025-03-21 08:18:46 +01:00
tznind
4316378f6e Make tests pass 2025-03-21 08:18:46 +01:00
tznind
323c624046 WIP: Add fluent assertions and prototype the kind of things that should be possible 2025-03-21 08:18:46 +01:00
tznind
c511101dfe Investigate fluent assertions for testing v2 2025-03-21 08:18:46 +01:00
BDisp
8b5639e5e5 Using SubViews and letting the top-level handle the key if the TabView doesn't handle it 2025-03-21 08:17:37 +01:00
BDisp
2ed7bb76c3 Fixes #3974. TabView steals keypresses from active ContextMenu 2025-03-21 08:17:37 +01:00
Tonttu
9735d8c584 Consistent kilobyte unit in comments v2.0.0-develop.4376 2025-03-17 16:17:46 +01:00
Tonttu
cf2645fa04 StringExtensions.ToString(IEnumerable<Rune>) use rented array as alternative buffer 2025-03-17 16:17:46 +01:00
Tonttu
9b78961a03 StringExtensions.ToString(IEnumerable<Rune>) remove extra rune chars copy 2025-03-17 16:17:46 +01:00
Tonttu
2e4e73a436 Rewrite TextFormatter.RemoveHotKeySpecifier
Uses stackalloc char buffer with fallback to rented array.
2025-03-17 16:17:46 +01:00
Tonttu
5ab51fc08b StringExtensions.ToString(IEnumerable<Rune>) stackalloc char buffer with StringBuilder fallback 2025-03-17 16:17:46 +01:00
Tonttu
b6a5ca1d4e Rewrite StringExtensions.ToString(IEnumerable<Rune>)
Appends rune chars to StringBuilder avoiding intermediate string allocation for each rune append.
2025-03-17 16:17:46 +01:00
Tonttu
aeffe3e36e Add benchmark category to the TextFormatter benchmarks 2025-03-17 16:17:46 +01:00
Tonttu
662e745395 Rewrite TextFormatter.ReplaceCRLFWithSpace
Almost identical to the StripCRLF implementation.
2025-03-17 16:17:46 +01:00
Tonttu
7d317ba550 StripCRLF early exit when no newline to avoid StringBuilder allocation 2025-03-17 16:17:46 +01:00
Tonttu
40d4cab510 More varied text permutations for the StripCRLF benchmark 2025-03-17 16:17:46 +01:00
Tonttu
6f63dca591 Rewrite TextFormatter.StripCRLF
Uses StringBuilder and char span indexof search to reduce intermediate allocations.

The new implementation behaves slightly different compared to old implementation. In synthetic LFCR scenario it is correctly removed while the old implementation left the CR, which seems like an off-by-one error.
2025-03-17 16:17:46 +01:00
Tonttu
c4502b0741 Add tests for TextFormatter StripCRLF and ReplaceCRLFWithSpace
Also made the helper methods internal so they can be accessed from the test project.
2025-03-17 16:17:46 +01:00
Tig
384cefcdf1 Merge branch 'v2_develop' of tig:gui-cs/Terminal.Gui into v2_develop v2.0.0-develop.4375 2025-03-17 15:59:37 +01:00
BDisp
56c8b20e24 Fixes #3986. ContextMenu crashing with right and left arrows 2025-03-17 07:39:19 +01:00
Tig
726770f6ee Merge branch 'v2_develop' of tig:tig/Terminal.Gui into v2_develop v2.0.0-develop.4374 2025-03-16 20:45:34 +01:00
BDisp
76a14d456d Fixes #3986. ContextMenus now broken in v2 net and win drivers (#3987) 2025-03-16 07:51:35 +01:00
Tig
f84c528449 Merge branch 'v2_develop' of tig:gui-cs/Terminal.Gui into v2_develop 2025-03-13 18:18:00 +01:00
Tig
ce7fc04100 Fixes #3984 - Margin w/out shadow should not force draw (#3985)
* shortcut tests

* Generic demos

* Optimize Margin to not defer draw if there's no shadow
2025-03-13 18:16:53 +01:00
Tonttu
b09b4e78bd Fix Cell.CombiningMarks property getter rune list allocation (#3980)
* Skip rune list allocation from accessing Cell.CombiningMarks property

The getter would every time allocate a new list when the backing field was not assigned, which is most of the time.

* Fix comment about performance

I accidentally word. Is this dangerous?
2025-03-13 18:15:49 +01:00
BDisp
7aae0c2ad5 Fixes #3968. Menu appears in wrong place when opened in a subview (#3979)
* Fixes #3968. Menu appears in wrong place when opened in a subview

* Fixes #3965. Cannot exit a Window with a CanFocus true MenuBar

* Fixes #3981. Drivers crash when middle or right click on a ContextMenu item

---------

Co-authored-by: Tig <tig@users.noreply.github.com>
2025-03-13 18:15:14 +01:00
Tonttu
ef20ff68a9 Reduce string allocations in IConsoleOutput implementations (#3978)
* Change IConsoleOutput.Write(string) overload parameter to ReadOnlySpan<char>

Allows the caller more flexibility about choosing a buffer per use case.

* NetOutput: Write StringBuilder directly to the std out text stream

* Add EscSeqUtils.CSI_WriteCursorPosition

Writes cursor position sequence to text writer without string allocation.

* NetOutput: Skip cursor position escape sequence string allocation

* Replace CSI_(Enable|Disable)MouseEvents static properties with readonly fields

Changed for the sake of consistency with rest of the EscSegutils fields rather than performance. Also prevents bugs from accidentally setting the properties.

* Use EscSeqUtils.CSI_Append(Foreground|Background)ColorRGB in v2 drivers

* WindowsOutput SetCursorVisibility: Remove intermediate string builder

* WindowsOutput.WriteToConsole: Use rented array as intermediate write buffer

The large intermediate string builder remains a challenge. :)

* NetOutput: Console.Out for the sake of consistency

Also might have missed one of the Console.Out.Write(StringBuilder) calls...

* Avoid Rune.ToString() in NetOutput.Write(IOutputBuffer)

---------

Co-authored-by: Tig <tig@users.noreply.github.com>
2025-03-13 18:14:22 +01:00
Tig
0831b162a1 Merge branch 'v2_develop' of tig:tig/Terminal.Gui into v2_develop 2025-03-13 08:00:30 +01:00
BDisp
af633fc4fc Fixes #3976. SixLabors.ImageSharp nuget package is reporting as vulnerable (#3977)
* Fixes #3976. SixLabors.ImageSharp nuget package is reporting as vulnerable

* Upgrade all nuget packages
2025-03-09 20:08:26 -06:00
Tig
7c89a3a176 Merge branch 'v2_develop' of tig:tig/Terminal.Gui into v2_develop 2025-03-09 13:46:41 -06:00
Tig
3794c34d30 shortcut tests 2025-03-09 13:46:35 -06:00
Tig
e0f61abf8a Merge branch 'v2_develop' of tig:tig/Terminal.Gui into v2_develop 2025-03-09 09:57:43 -06:00