Skip to content

Commit

Permalink
sort directory contents before zipping
Browse files Browse the repository at this point in the history
  • Loading branch information
kMutagene committed Oct 26, 2023
1 parent 57de162 commit 8387a24
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
6 changes: 5 additions & 1 deletion src/ARCTokenization/RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
### 1.1.0 - (Released 2023-8-21)
### 1.2.0 - (Released 2023-10-26)
- Additions:
- [Add file system tokenization](https://github.com/nfdi4plants/ARCTokenization/commit/57de162d50c918f1e245f1aa34db0a6b1660ba3b)

### 1.1.0 - (Released 2023-10-25)
- Additions:
- [Add some temporary static modules representing structural ontologies](https://github.com/nfdi4plants/ARCTokenization/commit/7d37cfc8a52accbc37df63e95a39d2684e66535f)

Expand Down
6 changes: 5 additions & 1 deletion tests/ARCTokenization.Tests/ReferenceObjects.fs
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ module Tokenization =
v = v
)
)
|> List.sortBy (fun cvp -> cvp.Value |> ParamValue.getValueAsString)

let referenceAbsoluteDirectoryPaths(root) =
[
Expand All @@ -186,6 +187,7 @@ module Tokenization =
v = v.Replace("\\", "/")
)
)
|> List.sortBy (fun cvp -> cvp.Value |> ParamValue.getValueAsString)

let referenceRelativeFilePaths =
[
Expand All @@ -199,6 +201,7 @@ module Tokenization =
v = v
)
)
|> List.sortBy (fun cvp -> cvp.Value |> ParamValue.getValueAsString)

let referenceAbsoluteFilePaths(root) =
[
Expand All @@ -212,4 +215,5 @@ module Tokenization =
cvTerm = CvTerm.create("AFSO:00000009","File Path","AFSO"),
v = v.Replace("\\", "/")
)
)
)
|> List.sortBy (fun cvp -> cvp.Value |> ParamValue.getValueAsString)
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module FileSystem =
open ReferenceObjects.Tokenization.FileSystem
open System.IO

let parsedRelativeDirectoryPaths = FS.tokenizeRelativeDirectoryPaths (Path.GetFullPath("Fixtures/testPaths/")) |> List.ofSeq
let parsedRelativeDirectoryPaths = FS.tokenizeRelativeDirectoryPaths (Path.GetFullPath("Fixtures/testPaths/")) |> List.ofSeq |> List.sortBy (fun cvp -> cvp.Value |> ParamValue.getValueAsString)

[<Fact>]
let ``Relative directory paths are tokenized correctly`` () =
Expand All @@ -20,7 +20,7 @@ module FileSystem =
fun (e, a) -> Assert.True(e.Equals(a))
)

let parsedRelativeFilePaths = FS.tokenizeRelativeFilePaths (Path.GetFullPath("Fixtures/testPaths/")) |> List.ofSeq
let parsedRelativeFilePaths = FS.tokenizeRelativeFilePaths (Path.GetFullPath("Fixtures/testPaths/")) |> List.ofSeq |> List.sortBy (fun cvp -> cvp.Value |> ParamValue.getValueAsString)

[<Fact>]
let ``Relative file paths are tokenized correctly`` () =
Expand All @@ -31,7 +31,7 @@ module FileSystem =
fun (e, a) -> Assert.True(e.Equals(a))
)

let parsedAbsoluteDirectoryPaths = FS.tokenizeAbsoluteDirectoryPaths (Path.GetFullPath("Fixtures/testPaths/")) |> List.ofSeq
let parsedAbsoluteDirectoryPaths = FS.tokenizeAbsoluteDirectoryPaths (Path.GetFullPath("Fixtures/testPaths/")) |> List.ofSeq |> List.sortBy (fun cvp -> cvp.Value |> ParamValue.getValueAsString)

[<Fact>]
let ``Absolute directory paths are tokenized correctly`` () =
Expand All @@ -42,7 +42,7 @@ module FileSystem =
fun (e, a) -> Assert.True(e.Equals(a))
)

let parsedAbsoluteFilePaths = FS.tokenizeAbsoluteFilePaths (Path.GetFullPath("Fixtures/testPaths/")) |> List.ofSeq
let parsedAbsoluteFilePaths = FS.tokenizeAbsoluteFilePaths (Path.GetFullPath("Fixtures/testPaths/")) |> List.ofSeq |> List.sortBy (fun cvp -> cvp.Value |> ParamValue.getValueAsString)

[<Fact>]
let ``Absolute file paths are tokenized correctly`` () =
Expand Down

0 comments on commit 8387a24

Please sign in to comment.