diff options
author | Daniel Ebert | 2023-08-11 10:26:27 +0000 |
---|---|---|
committer | Blaž Hrastnik | 2023-08-11 14:44:02 +0000 |
commit | b315901cbb137fd1b2f79bb9c1f10a1bef5b7f38 (patch) | |
tree | 646b57d87fc321abc4237129359a6342d0961cc7 /helix-core/tests/data/indent/cpp.cpp | |
parent | 155cedc5c839dafcef32310dc53bdc20ec976535 (diff) |
Run indentation tests on a part of the Helix source code.
Add C++ indent test file.
Diffstat (limited to 'helix-core/tests/data/indent/cpp.cpp')
-rw-r--r-- | helix-core/tests/data/indent/cpp.cpp | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/helix-core/tests/data/indent/cpp.cpp b/helix-core/tests/data/indent/cpp.cpp new file mode 100644 index 00000000..6e7f3a88 --- /dev/null +++ b/helix-core/tests/data/indent/cpp.cpp @@ -0,0 +1,48 @@ +std::vector<std::string> +fn_with_many_parameters(int parm1, long parm2, float parm3, double parm4, + char* parm5, bool parm6); + +std::vector<std::string> +fn_with_many_parameters(int parm1, long parm2, float parm3, double parm4, + char* parm5, bool parm6) { + auto lambda = []() { + return 0; + }; + auto lambda_with_a_really_long_name_that_uses_a_whole_line + = [](int some_more_aligned_parameters, + std::string parm2) { + do_smth(); + }; + if (brace_on_same_line) { + do_smth(); + } else if (brace_on_next_line) + { + do_smth(); + } else if (another_condition) { + do_smth(); + } + else { + do_smth(); + } + if (inline_if_statement) + do_smth(); + if (another_inline_if_statement) + return [](int parm1, char* parm2) { + this_is_a_really_pointless_lambda(); + }; + + switch (var) { + case true: + return -1; + case false: + return 42; + } +} + +class MyClass : public MyBaseClass { +public: + MyClass(); + void public_fn(); +private: + super_secret_private_fn(); +} |