// This file was auto-generated based on version 1.1.0 of the canonical data. module AnagramTest open FsUnit.Xunit open Xunit open Anagram [] let ``No matches`` () = let candidates = ["hello"; "world"; "zombies"; "pants"] anagrams candidates "diaper" |> should be Empty [] let ``Detects simple anagram`` () = let candidates = ["tan"; "stand"; "at"] anagrams candidates "ant" |> should equal ["tan"] [] let ``Does not detect false positives`` () = let candidates = ["eagle"] anagrams candidates "galea" |> should be Empty [] let ``Detects two anagrams`` () = let candidates = ["stream"; "pigeon"; "maters"] anagrams candidates "master" |> should equal ["stream"; "maters"] [] let ``Does not detect anagram subsets`` () = let candidates = ["dog"; "goody"] anagrams candidates "good" |> should be Empty [] let ``Detects anagram`` () = let candidates = ["enlists"; "google"; "inlets"; "banana"] anagrams candidates "listen" |> should equal ["inlets"] [] let ``Detects three anagrams`` () = let candidates = ["gallery"; "ballerina"; "regally"; "clergy"; "largely"; "leading"] anagrams candidates "allergy" |> should equal ["gallery"; "regally"; "largely"] [] let ``Does not detect identical words`` () = let candidates = ["corn"; "dark"; "Corn"; "rank"; "CORN"; "cron"; "park"] anagrams candidates "corn" |> should equal ["cron"] [] let ``Does not detect non-anagrams with identical checksum`` () = let candidates = ["last"] anagrams candidates "mass" |> should be Empty [] let ``Detects anagrams case-insensitively`` () = let candidates = ["cashregister"; "Carthorse"; "radishes"] anagrams candidates "Orchestra" |> should equal ["Carthorse"] [] let ``Detects anagrams using case-insensitive subject`` () = let candidates = ["cashregister"; "carthorse"; "radishes"] anagrams candidates "Orchestra" |> should equal ["carthorse"] [] let ``Detects anagrams using case-insensitive possible matches`` () = let candidates = ["cashregister"; "Carthorse"; "radishes"] anagrams candidates "orchestra" |> should equal ["Carthorse"] [] let ``Does not detect a word as its own anagram`` () = let candidates = ["Banana"] anagrams candidates "banana" |> should be Empty [] let ``Does not detect a anagram if the original word is repeated`` () = let candidates = ["go Go GO"] anagrams candidates "go" |> should be Empty [] let ``Anagrams must use all letters exactly once`` () = let candidates = ["patter"] anagrams candidates "tapper" |> should be Empty [] let ``Capital word is not own anagram`` () = let candidates = ["Banana"] anagrams candidates "BANANA" |> should be Empty