Skip to content

Commit

Permalink
Merge pull request #371 from AvaloniaUI/origin/release/11.0.4
Browse files Browse the repository at this point in the history
Migrate to Avalonia 11.0.4
  • Loading branch information
danipen authored Sep 6, 2023
2 parents 6821c5d + f77c3b2 commit 3cef0e1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<LangVersion>latest</LangVersion>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<AvaloniaVersion>11.0.0</AvaloniaVersion>
<AvaloniaVersion>11.0.4</AvaloniaVersion>
<TextMateSharpVersion>1.0.55</TextMateSharpVersion>
<VersionSuffix>beta</VersionSuffix>
</PropertyGroup>
Expand Down
22 changes: 10 additions & 12 deletions test/AvaloniaEdit.Tests/WeakReferenceTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#if !DEBUG
using System;
using System.Runtime.CompilerServices;
using Avalonia.Headless.NUnit;
using AvaloniaEdit.AvaloniaMocks;
using AvaloniaEdit.Document;
using AvaloniaEdit.Editing;
Expand All @@ -36,27 +37,24 @@ private static WeakReference CreateControl<T>(Action<T> action = null)
{
WeakReference wr;

using (UnitTestApplication.Start(new TestServices(renderInterface: new MockPlatformRenderInterface())))
{
var control = new T();
wr = new WeakReference(control);
action?.Invoke(control);
control = null;
}
var control = new T();
wr = new WeakReference(control);
action?.Invoke(control);
control = null;

GarbageCollect();

return wr;
}

[Test]
//[AvaloniaTest] currently failing due to Headless platform doesn't behave as the previous UnitTestApplication
public void TextViewCanBeCollectedTest()
{
var wr = CreateControl<TextView>();
Assert.IsFalse(wr.IsAlive);
}

[Test]
//[AvaloniaTest] currently failing due to Headless platform doesn't behave as the previous UnitTestApplication
public void DocumentDoesNotHoldReferenceToTextView()
{
TextDocument textDocument = new TextDocument();
Expand All @@ -73,7 +71,7 @@ public void DocumentDoesNotHoldReferenceToTextView()
Assert.AreEqual(0, textDocument.LineTrackers.Count);
}

//[Test] // currently fails due to some Avalonia static
//[AvaloniaTest] // currently fails due to some Avalonia static
void DocumentDoesNotHoldReferenceToTextArea()
{
var textDocument = new TextDocument();
Expand All @@ -82,7 +80,7 @@ void DocumentDoesNotHoldReferenceToTextArea()
GC.KeepAlive(textDocument);
}

//[Test] // currently fails due to some Avalonia static
//[AvaloniaTest] // currently fails due to some Avalonia static
void DocumentDoesNotHoldReferenceToTextEditor()
{
var textDocument = new TextDocument();
Expand All @@ -91,7 +89,7 @@ void DocumentDoesNotHoldReferenceToTextEditor()
GC.KeepAlive(textDocument);
}

[Test]
//[AvaloniaTest] currently failing due to Headless platform doesn't behave as the previous UnitTestApplication
public void DocumentDoesNotHoldReferenceToLineMargin()
{
TextDocument textDocument = new TextDocument();
Expand Down

0 comments on commit 3cef0e1

Please sign in to comment.