Skip to content

Instantly share code, notes, and snippets.

@stephen-swensen
Created June 12, 2012 20:26
Show Gist options
  • Save stephen-swensen/2919920 to your computer and use it in GitHub Desktop.
Save stephen-swensen/2919920 to your computer and use it in GitHub Desktop.
//Unquote (http://code.google.com/p/unquote/) solution to http://stackoverflow.com/questions/11002754/list-member-equality-in-fsunit.
//The following example is shown in FSI, but unquote works configuration free with NUnit, xUnit.net, and all other exception-based unit testing frameworks.
#r @"C:\Unquote.dll"
open Swensen.Unquote
let x = [1;5;3;1;2;4]
let y = [4;3;5;2;1]
test <@ List.sort x = List.sort y @>
//----FSI Output----
(*
Test failed:
List.sort x = List.sort y
List.sort [1; 5; 3; 1; 2; 4] = List.sort [4; 3; 5; 2; 1]
[1; 1; 2; 3; 4; 5] = [1; 2; 3; 4; 5]
false
*)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment