Make threading tests more brief.

This commit is contained in:
Sage Vaillancourt 2022-04-06 00:05:30 -04:00
parent 67691e36bc
commit 99a9b9a2b6
1 changed files with 5 additions and 4 deletions

View File

@ -12,13 +12,14 @@ void cleanPromise(struct Promise* promise);
int isDone(struct Promise* promise); int isDone(struct Promise* promise);
fn(async, "async", fn(async, "async",
"Run the given lambda on a separate thread.", "Run the given lambda on a separate thread, returning a promise.",
"(def sleepy (fn () ((sys \"sleep 0.1\") \"Hiya\"))) (def x (async sleepy)) x", "<PENDING>", "(def sleepy (fn () ((sys \"sleep 0.01\") \"Hiya\"))) (def x (async sleepy)) x", "<PENDING>",
"(def sleepy (fn () ((sys \"sleep 0.1\") \"Hiya\"))) (def x (async sleepy)) (await x)", "Hiya", "(def sleepy (fn () ((sys \"sleep 0.01\") \"Hiya\"))) (def x (async sleepy)) (await x)", "Hiya",
); );
fn(await, "await", fn(await, "await",
"" "Waits for a promise to resolve before proceeding.",
"(def sleepy (fn () ((sys \"sleep 0.01\") \"Hiya\"))) (def x (async sleepy)) (await x)", "Hiya",
); );
#endif // PEBBLISP_THREADS_H #endif // PEBBLISP_THREADS_H