-
Notifications
You must be signed in to change notification settings - Fork 174
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- don’t do function copying in benchmarking - fix the array_update benchmark - add Filepath.file-from-path - add tests for the `Filepath` module - reformat a lot of documentation
- Loading branch information
Showing
11 changed files
with
81 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
(defmodule Geometry | ||
(doc degree-to-radians "Converts degrees expressed as a double into radians.") | ||
(doc degree-to-radians "converts degrees expressed as a double `n` into radians.") | ||
(defn degree-to-radians [n] | ||
(Double.* n (Double./ Double.pi 180.0))) | ||
|
||
(doc radians-to-degree "Converts radians expressed as a double into degree.") | ||
(doc radians-to-degree "converts radians expressed as a double `n` into degrees.") | ||
(defn radians-to-degree [n] | ||
(Double.* n (Double./ 180.0 Double.pi))) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
(load "Filepath.carp") | ||
(load "Test.carp") | ||
|
||
(use-all Test Filepath) | ||
|
||
(deftest test | ||
(assert-equal test | ||
"test.h" | ||
&(file-from-path "/an/absolute/path/for/test.h") | ||
"file-from-path works with non-empty paths" | ||
) | ||
(assert-equal test | ||
"." | ||
&(file-from-path ".") | ||
"file-from-path works with relative paths" | ||
) | ||
(assert-equal test | ||
"" | ||
&(file-from-path "") | ||
"file-from-path works with empty paths" | ||
) | ||
(assert-equal test | ||
"/an/absolute/path/for/" | ||
&(dir-from-path "/an/absolute/path/for/test.h") | ||
"dir-from-path works with non-empty paths" | ||
) | ||
(assert-equal test | ||
"" | ||
&(dir-from-path ".") | ||
"dir-from-path works with relative paths" | ||
) | ||
(assert-equal test | ||
"" | ||
&(dir-from-path "") | ||
"dir-from-path works with empty paths" | ||
) | ||
) |