Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/DynamicObj/DynamicObj.fs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
| Some pi -> Some pi
| None -> this.TryGetDynamicPropertyHelper propertyName

/// <summary>

Check warning on line 78 in src/DynamicObj/DynamicObj.fs

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest)

This XML comment is incomplete: no documentation for parameter 'propertyName'

Check warning on line 78 in src/DynamicObj/DynamicObj.fs

View workflow job for this annotation

GitHub Actions / test (windows-latest)

This XML comment is incomplete: no documentation for parameter 'propertyName'
/// Returns Some(boxed property value) if a dynamic (or static) property with the given name exists, otherwise None.
/// </summary>
/// <param name="name">the name of the property to get</param>
Expand Down Expand Up @@ -420,15 +420,15 @@
let c = en.Current :?> System.Collections.DictionaryEntry
HashCodes.mergeHashes (hash c.Key) (HashUtils.deepHash c.Value)
]
|> List.reduce HashCodes.mergeHashes
|> fun l -> if l.IsEmpty then 0 else l |> List.reduce HashCodes.mergeHashes
#endif
| :? System.Collections.IEnumerable as e ->
let en = e.GetEnumerator()
[
while en.MoveNext() do
HashUtils.deepHash en.Current
]
|> List.reduce HashCodes.mergeHashes
|> fun l -> if l.IsEmpty then 0 else l |> List.reduce HashCodes.mergeHashes
| _ -> DynamicObj.HashCodes.hash o

and CopyUtils =
Expand Down
8 changes: 8 additions & 0 deletions tests/DynamicObject.Tests/HashUtils.fs
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ let tests_Dictionary =

let tests_Lists =
testList "Lists" [
testCase "Empty" <| fun _ ->
Expect.equal (HashUtils.deepHash []) (HashUtils.deepHash []) "Empty List should return consistent Hash"
testList "Shuffled Int" [
testCase "1v1" <| fun _ ->
Expect.equal (HashUtils.deepHash intList1) (HashUtils.deepHash intList1) "Same List should return consistent Hash"
Expand All @@ -167,6 +169,8 @@ let tests_Lists =

let tests_Array =
testList "Array" [
testCase "Empty" <| fun _ ->
Expect.equal (HashUtils.deepHash [||]) (HashUtils.deepHash [||]) "Empty Array should return consistent Hash"
testList "Shuffled Int" [
testCase "1v1" <| fun _ ->
Expect.equal (HashUtils.deepHash intArray1) (HashUtils.deepHash intArray1) "Same Array should return consistent Hash"
Expand All @@ -179,6 +183,8 @@ let tests_Array =

let tests_Seq =
testList "Seq" [
testCase "Empty" <| fun _ ->
Expect.equal (HashUtils.deepHash Seq.empty) (HashUtils.deepHash Seq.empty) "Empty Seq should return consistent Hash"
testList "Shuffled Int" [
testCase "1v1" <| fun _ ->
Expect.equal (HashUtils.deepHash intSeq1) (HashUtils.deepHash intSeq1) "Same Seq should return consistent Hash"
Expand All @@ -191,6 +197,8 @@ let tests_Seq =

let tests_ResizeArray =
testList "ResizeArray" [
testCase "Empty" <| fun _ ->
Expect.equal (HashUtils.deepHash (ResizeArray [])) (HashUtils.deepHash (ResizeArray [])) "Empty ResizeArray should return consistent Hash"
testList "Shuffled Int" [
testCase "1v1" <| fun _ ->

Expand Down
Loading