Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[cpp refactor] Finish creating separate cc_library() targets
This is just about "what the code will look like".
- Loading branch information
Andy C
committed
Nov 13, 2022
1 parent
f8a9a8c
commit dd80325
Showing
11 changed files
with
89 additions
and
53 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
File renamed without changes.
File renamed without changes.
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,4 +1,5 @@ | ||
#include "cpp/osh.h" | ||
|
||
#include "cpp/core_error.h" | ||
#include "mycpp/runtime.h" | ||
#include "vendor/greatest.h" | ||
|
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,42 @@ | ||
#include "cpp/pylib.h" | ||
|
||
#include "mycpp/runtime.h" | ||
#include "vendor/greatest.h" | ||
|
||
TEST os_path_test() { | ||
// TODO: use gc_mylib here, with NewStr(), StackRoots, etc. | ||
Str* s = nullptr; | ||
|
||
s = os_path::rstrip_slashes(StrFromC("")); | ||
ASSERT(str_equals(s, StrFromC(""))); | ||
|
||
s = os_path::rstrip_slashes(StrFromC("foo")); | ||
ASSERT(str_equals(s, StrFromC("foo"))); | ||
|
||
s = os_path::rstrip_slashes(StrFromC("foo/")); | ||
ASSERT(str_equals(s, StrFromC("foo"))); | ||
|
||
s = os_path::rstrip_slashes(StrFromC("/foo/")); | ||
ASSERT(str_equals(s, StrFromC("/foo"))); | ||
|
||
// special case of not stripping | ||
s = os_path::rstrip_slashes(StrFromC("///")); | ||
ASSERT(str_equals(s, StrFromC("///"))); | ||
|
||
PASS(); | ||
} | ||
|
||
GREATEST_MAIN_DEFS(); | ||
|
||
int main(int argc, char** argv) { | ||
gHeap.Init(); | ||
|
||
GREATEST_MAIN_BEGIN(); | ||
|
||
RUN_TEST(os_path_test); | ||
|
||
gHeap.CleanProcessExit(); | ||
|
||
GREATEST_MAIN_END(); | ||
return 0; | ||
} |
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