Added tests

This commit is contained in:
Devine Lu Linvega 2024-04-27 11:24:00 -07:00
parent 3d01efe11a
commit 62b8317cc9
2 changed files with 16 additions and 2 deletions

View File

@ -93,6 +93,19 @@ reverse (modal) = ladom (reverse 1) test
nap tap (inline 1) test
?(?-) (Undefinition)
<> (undefine-me) (abc)
<> (undefine-me) (def)
<> (undefine-me) (ghi)
>< (undefine-me)
(undefine-me) = (def) (undefinition 1) test
>< (undefine-me)
(undefine-me) = (ghi) (undefinition 2) test
?(?-) (Late Test Primitives)
<> (?x = ?y ?n test) (?(?: ?:) (#fail ?n found: ?x expect: ?y\n))

View File

@ -196,8 +196,9 @@ find_rule(char *s, char *cap)
if(*s == '(') s++, cap--;
while(r < rules_) {
char *ss = s, *a = r->a;
while(*ss++ == *a++)
if(!*a && ss == cap) return r;
if(a)
while(*ss++ == *a++)
if(!*a && ss == cap) return r;
r++;
}
return r;