Commit ee8c1fad authored by Xavier Thompson's avatar Xavier Thompson

Remove obsolete test programs

parent dad6e407
#!/bin/bash
set -e
rm mixed_fibo || true
make mixed_fibo
for i in {0..100}
do
./mixed_fibo
done
echo "ok"
#include <typon/task.hpp>
#include <cstdio>
using namespace typon;
Task<int> fibo(int n) {
if (n < 2) {
co_return n;
}
int a = co_await fibo(n - 1);
int b = co_await fibo(n - 2);
co_return a + b;
}
int main() {
int result = fibo(40).call();
printf("%d\n", result);
}
#include <typon/task.hpp>
#include <cstdio>
using namespace typon;
Task<int> add(int a, int b) {
printf("add(%d, %d)\n", a, b);
co_return a + b;
}
Task<int> call_add_but_ignore_result(int a, int b) {
co_await add(a, b).discard();
co_return 1;
}
int main() {
call_add_but_ignore_result(2, 3).call_discard();
}
#include <typon/task.hpp>
#include <cstdio>
using namespace typon;
Task<int> add(int a, int b) {
co_return a + b;
}
Task<int> add_indirection(int a, int b) {
co_return co_await add(a, b);
}
int main() {
int result = add_indirection(2, 3).call();
return result;
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment