From 64e6c6318f6d024f9111f751036b19de7ef6fafa Mon Sep 17 00:00:00 2001 From: ElektroKill Date: Mon, 24 Apr 2023 19:43:50 +0200 Subject: [PATCH] Add unit test --- .../TestCases/Pretty/ReduceNesting.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/ReduceNesting.cs b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/ReduceNesting.cs index ece018663..296914030 100644 --- a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/ReduceNesting.cs +++ b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/ReduceNesting.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty { @@ -566,5 +567,19 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty } } } + + private static string DuplicateReturnTest(IDictionary dict) + { + string value; + lock (dict) + { + if (!dict.TryGetValue(1, out value)) + { + value = "test"; + dict.Add(1, value); + } + } + return value; + } } }