diff options
| author | ruki <[email protected]> | 2019-09-06 22:48:20 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2019-09-06 10:50:04 +0800 |
| commit | 5c0286dd6ec8c3f8bf7e6c4e7cecd9d5903948e8 (patch) | |
| tree | 48744c44f2cbf71de66ff1bf5f5b9b2d015b8bde /tests/projects/c++/modules/impl_unit/src | |
| parent | e5152e174154dde4f9fdd3f49047f36c0966d7ea (diff) | |
add impl_unit tests
Diffstat (limited to 'tests/projects/c++/modules/impl_unit/src')
| -rw-r--r-- | tests/projects/c++/modules/impl_unit/src/hello.mpp | 10 | ||||
| -rw-r--r-- | tests/projects/c++/modules/impl_unit/src/hello_impl.cpp | 19 | ||||
| -rw-r--r-- | tests/projects/c++/modules/impl_unit/src/main.cpp | 8 |
3 files changed, 37 insertions, 0 deletions
diff --git a/tests/projects/c++/modules/impl_unit/src/hello.mpp b/tests/projects/c++/modules/impl_unit/src/hello.mpp new file mode 100644 index 000000000..0b65bf24e --- /dev/null +++ b/tests/projects/c++/modules/impl_unit/src/hello.mpp @@ -0,0 +1,10 @@ +export module hello; + +namespace hello { + void say_hi(); +} + +export namespace hello { + void say_hello(); + void say_xz(); +}
\ No newline at end of file diff --git a/tests/projects/c++/modules/impl_unit/src/hello_impl.cpp b/tests/projects/c++/modules/impl_unit/src/hello_impl.cpp new file mode 100644 index 000000000..1c9968a51 --- /dev/null +++ b/tests/projects/c++/modules/impl_unit/src/hello_impl.cpp @@ -0,0 +1,19 @@ +// module; +#include <iostream> +module hello; + +using namespace std; + +namespace hello { + void say_hi() { + cout << "hello hi!" << endl; + } + + void say_hello() { + cout << "hello world!" << endl; + } + + void say_xz() { + cout << "hello xz!" << endl; + } +} diff --git a/tests/projects/c++/modules/impl_unit/src/main.cpp b/tests/projects/c++/modules/impl_unit/src/main.cpp new file mode 100644 index 000000000..378861561 --- /dev/null +++ b/tests/projects/c++/modules/impl_unit/src/main.cpp @@ -0,0 +1,8 @@ +import hello; + +int main() { + hello::say_hello(); + hello::say_xz(); + // hello::say_hi(); + return 0; +}
\ No newline at end of file |
