Mercurial
comparison dowa/dowa_test.c @ 260:1f9877b637e9
Add Copilot-powered cyberpunk JRPG chat
Integrate the production JRPG chat with Seobeo streaming, Deita persistence, and a Bazel-managed Copilot SDK and LiteLLM inference stack.
Co-authored-by: Copilot <[email protected]>
| author | MrJuneJune <mrjunejune@users.noreply.github.com> |
|---|---|
| date | Wed, 05 Aug 2026 09:19:41 -0700 |
| parents | 655ea0b661fd |
| children | 04fee26ecce0 |
comparison
equal
deleted
inserted
replaced
| 259:667156fcd3e3 | 260:1f9877b637e9 |
|---|---|
| 313 { | 313 { |
| 314 char *uuid = Dowa_String_UUID((uint32)time(NULL), NULL); | 314 char *uuid = Dowa_String_UUID((uint32)time(NULL), NULL); |
| 315 printf("UUID %s\n", uuid); | 315 printf("UUID %s\n", uuid); |
| 316 } | 316 } |
| 317 | 317 |
| 318 { | |
| 319 Dowa_Arena *json_arena = Dowa_Arena_Create(1024); | |
| 320 char raw[] = {'"', '\\', '\n', '\t', 0x01, 'x', '\0'}; | |
| 321 char *escaped = Dowa_JSON_Escape_String(raw, 6, json_arena); | |
| 322 assert(escaped); | |
| 323 assert(strcmp(escaped, "\\\"\\\\\\n\\t\\u0001x") == 0); | |
| 324 Dowa_Arena_Free(json_arena); | |
| 325 } | |
| 326 | |
| 327 { | |
| 328 Dowa_Arena *json_arena = Dowa_Arena_Create(1024); | |
| 329 const char *source = "{\"message\":\"say \\\"hello\\\"\\\\now\"}"; | |
| 330 Dowa_JSON_Value parsed = Dowa_JSON_Parse( | |
| 331 source, (int32)strlen(source), json_arena); | |
| 332 assert(parsed.type == DOWA_JSON_OBJECT); | |
| 333 char *message = Dowa_JSON_Get_String(parsed.object_val, "message"); | |
| 334 assert(message); | |
| 335 assert(strcmp(message, "say \"hello\"\\now") == 0); | |
| 336 Dowa_Arena_Free(json_arena); | |
| 337 } | |
| 338 | |
| 318 printf("=== Math/Random === \n\n"); | 339 printf("=== Math/Random === \n\n"); |
| 319 | 340 |
| 320 printf("\n RandomNumberGenerator\n\n"); | 341 printf("\n RandomNumberGenerator\n\n"); |
| 321 { | 342 { |
| 322 uint32 seed_number = 32; | 343 uint32 seed_number = 32; |