Skip to content

Commit

Permalink
Add tests for filename splitting
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Luke committed Aug 3, 2016
1 parent 6f46ce5 commit 1c4c490
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion test/miscellaneous/helper.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,29 @@ facts("Miscellaneous") do

context("File parts") do

a, b, c = fileparts("")
@fact a --> ""
@fact b --> ""
@fact c --> ""

a, b, c = fileparts("/Users/test/subdir/test-file.bdf")
@fact a --> "/Users/test/subdir/"
@fact b --> "test-file"
@fact c --> "bdf"

a, b, c = fileparts("/Users/test/subdir/test_file.bdf")
@fact a --> "/Users/test/subdir/"
@fact b --> "test_file"
@fact c --> "bdf"

a, b, c = fileparts("test-file.bdf")
@fact a --> ""
@fact b --> "test-file"
@fact c --> "bdf"
end

context("Find closest number index") do
@fact _find_closest_number_idx([1, 2, 2.7, 3.2, 4, 3.1, 7], 3) --> 6
end

end

0 comments on commit 1c4c490

Please sign in to comment.