public void Test_StringPool_GetOrAdd_ReadOnlySpan_Misc() { var pool = new StringPool(); string hello = pool.GetOrAdd(nameof(hello).AsSpan()), helloworld = pool.GetOrAdd(nameof(helloworld).AsSpan()), windowsCommunityToolkit = pool.GetOrAdd(nameof(windowsCommunityToolkit).AsSpan()); Assert.AreEqual(nameof(hello), hello); Assert.AreEqual(nameof(helloworld), helloworld); Assert.AreEqual(nameof(windowsCommunityToolkit), windowsCommunityToolkit); Assert.AreSame(hello, pool.GetOrAdd(hello.AsSpan())); Assert.AreSame(helloworld, pool.GetOrAdd(helloworld.AsSpan())); Assert.AreSame(windowsCommunityToolkit, pool.GetOrAdd(windowsCommunityToolkit.AsSpan())); pool.Reset(); Assert.AreEqual(nameof(hello), hello); Assert.AreEqual(nameof(helloworld), helloworld); Assert.AreEqual(nameof(windowsCommunityToolkit), windowsCommunityToolkit); Assert.AreNotSame(hello, pool.GetOrAdd(hello.AsSpan())); Assert.AreNotSame(helloworld, pool.GetOrAdd(helloworld.AsSpan())); Assert.AreNotSame(windowsCommunityToolkit, pool.GetOrAdd(windowsCommunityToolkit.AsSpan())); }