fix: use C syntax in tdd skill examples

auto trailing return types are C++ only. Split header and\nimplementation examples into C and C++ variants.
This commit is contained in:
2026-06-15 04:31:04 +02:00
parent 457b6651be
commit 2ba1d2f7b6
+23
View File
@@ -38,10 +38,21 @@ before the implementation was missing.
Create `<src>/<module>.h` with the public prototype(s).
C:
```c
#pragma once
#include <stddef.h>
int fn_name(int arg);
```
C++:
```cpp
#pragma once
#include <cstddef>
auto fn_name(int arg) -> int;
```
@@ -122,9 +133,21 @@ list(APPEND TEST_TARGETS test_<module>)
Create `<src>/<module>.c` with a dummy return:
C:
```c
#include "<src>/<module>.h"
int fn_name(int arg) {
return 0;
}
```
C++:
```cpp
#include "<src>/<module>.h"
auto fn_name(int arg) -> int {
return 0;
}