Skip to content

Instantly share code, notes, and snippets.

@theraot
Last active January 29, 2019 17:51
Show Gist options
  • Save theraot/1a5938d8df9890a3e1837272c1107b67 to your computer and use it in GitHub Desktop.
Save theraot/1a5938d8df9890a3e1837272c1107b67 to your computer and use it in GitHub Desktop.
using System;
using System.Collections.Generic;
public class Program
{
public static void Main()
{
// This is based on an old test from Mono
Console.WriteLine("Hello World");
var trio = new SortedSet<int> { 0, 1, 2 };
var digits = new SortedSet<int> { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
var nonTrio = digits.GetViewBetween(3, 5);
// Iterating the result of GetViewBetween does not change the problem
// This shows that GetViewBetween succeeds and can be iterated fully
Console.WriteLine("Iterating:");
foreach(var x in nonTrio)
{
Console.WriteLine(x);
}
Console.WriteLine("IsSubSetOf:");
// ArgumentOutOfRangeException (parameter name: lowerValue)
// Expected: false
Console.WriteLine(trio.IsSubsetOf((IEnumerable<int>)nonTrio));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment