-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(uri): add setter for path (#887)
Part of #811 --------- Signed-off-by: Tony Gorez <[email protected]>
- Loading branch information
Showing
6 changed files
with
332 additions
and
19 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#include <gtest/gtest.h> | ||
#include <sourcemeta/jsontoolkit/uri.h> | ||
|
||
TEST(URI_is_relative, dot_slash) { | ||
const sourcemeta::jsontoolkit::URI uri{"./foo"}; | ||
EXPECT_TRUE(uri.is_relative()); | ||
} | ||
|
||
TEST(URI_is_relative, dot_dot_slash) { | ||
const sourcemeta::jsontoolkit::URI uri{"../foo"}; | ||
EXPECT_TRUE(uri.is_relative()); | ||
} | ||
|
||
TEST(URI_is_relative, without_dot_and_slash) { | ||
const sourcemeta::jsontoolkit::URI uri{"foo"}; | ||
EXPECT_TRUE(uri.is_relative()); | ||
} | ||
|
||
TEST(URI_is_relative, unique_slash) { | ||
// The is a relative URI, even if the path is absolute. | ||
const sourcemeta::jsontoolkit::URI uri{"/foo"}; | ||
EXPECT_TRUE(uri.is_relative()); | ||
} |
Oops, something went wrong.