Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
//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