diff options
| author | Maxime Coste <mawww@kakoune.org> | 2023-10-25 12:51:16 +1100 |
|---|---|---|
| committer | Maxime Coste <mawww@kakoune.org> | 2023-10-25 12:51:16 +1100 |
| commit | b020922e6f241b3cc7dbce210f40bd4198af00ef (patch) | |
| tree | 72c3e108400f4ab598d2b5d0dec81bbdd91da0b0 /test | |
| parent | d50048d0b4d6cbce4a805bcfd7eb6c8944fc7bd1 (diff) | |
Fix some corner cases in c-family indentation
Diffstat (limited to 'test')
| -rw-r--r-- | test/indent/c-family/close-block/in | 12 | ||||
| -rw-r--r-- | test/indent/c-family/close-block/out | 15 | ||||
| -rw-r--r-- | test/indent/c-family/close-function-with-struct-param/in | 10 | ||||
| -rw-r--r-- | test/indent/c-family/close-function-with-struct-param/out | 12 |
4 files changed, 45 insertions, 4 deletions
diff --git a/test/indent/c-family/close-block/in b/test/indent/c-family/close-block/in index bc0901e8..7e52c42f 100644 --- a/test/indent/c-family/close-block/in +++ b/test/indent/c-family/close-block/in @@ -1,6 +1,14 @@ -struct A +template<typename T> struct A : B { - int i%(;) + struct C + { + void foo() { + bar()%(;) + }%(;) + +struct D { + void baz() %({) + int qux%(;) if (true) { if (true) { diff --git a/test/indent/c-family/close-block/out b/test/indent/c-family/close-block/out index b207dfd6..2f20296b 100644 --- a/test/indent/c-family/close-block/out +++ b/test/indent/c-family/close-block/out @@ -1,6 +1,17 @@ -struct A +template<typename T> struct A : B { - int i; + struct C + { + void foo() { + bar(); + } + }; +}; + +struct D { + void baz() { + } + int qux; }; if (true) { diff --git a/test/indent/c-family/close-function-with-struct-param/in b/test/indent/c-family/close-function-with-struct-param/in index c0a2e31c..97ff4736 100644 --- a/test/indent/c-family/close-function-with-struct-param/in +++ b/test/indent/c-family/close-function-with-struct-param/in @@ -6,3 +6,13 @@ void f(int i, void g(int i, struct S s) { %( ) + +struct T { + void h(int i, + struct S s) const { + %( ) + + void i(int i, + struct S s) const final { + %( ) +}; diff --git a/test/indent/c-family/close-function-with-struct-param/out b/test/indent/c-family/close-function-with-struct-param/out index 053db0aa..d7ba56c7 100644 --- a/test/indent/c-family/close-function-with-struct-param/out +++ b/test/indent/c-family/close-function-with-struct-param/out @@ -8,3 +8,15 @@ void g(int i, struct S s) { } + +struct T { + void h(int i, + struct S s) const { + + } + + void i(int i, + struct S s) const final { + + } +}; |
