1
1
mirror of https://github.com/github/semantic.git synced 2024-12-26 00:12:29 +03:00

Use symbols for keys.

This commit is contained in:
Rob Rix 2015-10-16 15:22:07 -04:00
parent e85566bfeb
commit 63ffe0a596

View File

@ -87,7 +87,7 @@ extension UnannotatedTerm: Arbitrary {
}
let keyed: Gen<Term> = Gen.sized { n in
Gen<Int>.choose((0, n)).bind { n in
sequence((0..<n).map { _ in String.arbitrary.bind { key in Gen.pure(()).bind { UnannotatedTerm.arbitrary }.fmap { (key, $0.term) } } }).fmap {
sequence((0..<n).map { _ in symbol.bind { key in Gen.pure(()).bind { UnannotatedTerm.arbitrary }.fmap { (key, $0.term) } } }).fmap {
Term((), .Keyed(Dictionary(elements: $0)))
}
}