Comentários: separadores com no máximo "---"
Trechos com quatro ou mais hífens dentro de comentários viram "---" (strings não mudam). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
374b445a8f
commit
80bd330766
40 files changed
+137
-137
No files matched your search
+1
-1
@@ -28,7 +28,7 @@ static void set_pts(TinyBlocks_Block* b, uint32_t i, TinyBlocks_JsonValue* pts)
|
||||
static bool near(double a, double b) { return fabs(a - b) < 1e-6; }
|
||||
|
||||
int main(void) {
|
||||
/* -- API C: reta ---- */
|
||||
/* -- API C: reta --- */
|
||||
TinyBlocks_JsonValue* ln = tb_curves_line(0, 0, 10, 20, 4);
|
||||
CHECK(tb_curves_count(ln) == 5, "reta com 4 passos -> 5 pontos");
|
||||
double x, y;
|
||||
|
||||
@@ -73,7 +73,7 @@ static const char* ty(const TbBpTab* t, int bi) { return bi >= 0 ? t->blocks[bi]
|
||||
int main(void) {
|
||||
char warn[256];
|
||||
|
||||
/* -- importar ---------------------------------------------------------- */
|
||||
/* -- importar --- */
|
||||
TbBpTab* t = fresh();
|
||||
int n = tb_scratchblocks_import(SCRIPT, t, &CX, warn, sizeof(warn));
|
||||
CHECK(n == 1 && !warn[0], "importa um script (uma pilha, sem avisos)");
|
||||
@@ -106,7 +106,7 @@ int main(void) {
|
||||
!strcmp(t->blocks[child(t, item, 0)].in_text[0], "frutas"),
|
||||
"item (1) of [frutas v] usa a lista com nome");
|
||||
|
||||
/* -- exportar ---------------------------------------------------------- */
|
||||
/* -- exportar --- */
|
||||
char* txt = tb_scratchblocks_export(t, &CX);
|
||||
CHECK(txt && !strcmp(txt, EXPECTED), "exporta igual ao texto do fórum");
|
||||
if (txt && strcmp(txt, EXPECTED)) printf("---- obtido:\n%s----\n", txt);
|
||||
@@ -118,7 +118,7 @@ int main(void) {
|
||||
CHECK(txt2 && txt && !strcmp(txt, txt2), "ida e volta (exportar(importar(texto))) é estável");
|
||||
free(txt); free(txt2); free(t2); free(t);
|
||||
|
||||
/* -- blocos só do TinyBlocks: rótulo em português + ::categoria ------- */
|
||||
/* -- blocos só do TinyBlocks: rótulo em português + ::categoria --- */
|
||||
t = fresh();
|
||||
n = tb_scratchblocks_import(
|
||||
"when flag clicked\n"
|
||||
@@ -141,14 +141,14 @@ int main(void) {
|
||||
CHECK(txt && strstr(txt, "forever\n set pen size to (4)\nend\n"), "sempre (tampa) com corpo");
|
||||
free(txt); free(t);
|
||||
|
||||
/* -- linha desconhecida: avisa e segue -------------------------------- */
|
||||
/* -- linha desconhecida: avisa e segue --- */
|
||||
t = fresh();
|
||||
n = tb_scratchblocks_import("when flag clicked\nvoe para a lua\nerase all\n", t, &CX, warn, sizeof(warn));
|
||||
CHECK(n == 1 && strstr(warn, "linha 2"), "linha desconhecida gera aviso com o número da linha");
|
||||
CHECK(!strcmp(ty(t, t->blocks[t->top[0]].next), "Stage.Clear"), "e o resto continua sendo importado");
|
||||
free(t);
|
||||
|
||||
/* -- texto com colchetes é escapado ----------------------------------- */
|
||||
/* -- texto com colchetes é escapado --- */
|
||||
t = fresh();
|
||||
tb_scratchblocks_import("say [a \\] b]\n", t, &CX, warn, sizeof(warn));
|
||||
CHECK(!strcmp(t->blocks[t->top[0]].in_text[0], "a ] b"), "\\] dentro de [ ] é texto");
|
||||
|
||||
+1
-1
@@ -198,7 +198,7 @@ int main(void) {
|
||||
tb_block_destroy(bs, rt);
|
||||
}
|
||||
|
||||
/* -- Conversoes de tipo ------------------------------------------------ */
|
||||
/* -- Conversoes de tipo --- */
|
||||
CHECK(is_real(run("Number.From", " 3,5 ", NULL, NULL), 3.5), "número de \" 3,5 \" (vírgula decimal)");
|
||||
CHECK(is_int(run("Number.From", "42", NULL, NULL), 42) && is_int(run("Number.From", "abc", NULL, NULL), 0),
|
||||
"número de texto: inteiro sai inteiro, não-número vira 0");
|
||||
|
||||
Reference in new issue
Block a user