error tests for selecting from an empty array

This commit is contained in:
dzaima 2025-06-09 18:26:09 +03:00
parent b13e4101fa
commit 3a8d0be5a4
2 changed files with 10 additions and 1 deletions

View File

@ -243,7 +243,7 @@ B select_c2(B t, B w, B x) {
B xf = getFillR(x);
usz xn = *SH(x);
if (xn==0) goto def_xf_base;
if (xn==0) goto def_xf_base; // empty x, non-empty w; error
usz csz = arr_csz(x);
u8 xl = cellWidthLog(x);
usz ria = wia * csz;

View File

@ -165,6 +165,15 @@ w←1‿1⥊1 ⋄ x←2⥊1 ⋄ w‿x <¨↩ ⋄ {! (∾⟨"𝕨",•Repr𝕩,
)
000 1310 %% 33012
¨ (203451)98070 08070 (23041)10 %% 20345807,0807,2304
!"𝕨⊏𝕩: Indices out of range" % %USE evar 00 _evar 0
!"𝕨⊏𝕩: Indices out of range" % %USE evar 00 _evar 021
!"𝕨⊏𝕩: Indices out of range" % %USE evar [00,00] _evar 0
!"𝕨⊏𝕩: Indices out of range" % %USE evar [00,00] _evar 001
!"𝕨⊏𝕩: Indices out of range" % %USE evar 00 _evar 021
!"𝕨⊏𝕩: Indices out of range" % %USE evar 00 _evar 0
!"𝕨⊏𝕩: Indices out of range" % %USE evar 00,00 _evar 201
!"𝕨⊏𝕩: Indexing out-of-bounds (0∊𝕨, 0≡≠𝕩)" % %USE evar 0 _evar 0
!"𝕨⊏𝕩: Indexing out-of-bounds (0∊𝕨, 0≡≠𝕩)" % %USE evar 0 _evar 0
!"𝕨⊏𝕩: Indexing out-of-bounds (1∊𝕨, 1≡≠𝕩)" % ˜(2001)1
!"𝕨⊏𝕩: Indexing out-of-bounds (24∊𝕨, 4≡≠𝕩)" % %USE evar 124 _evar 44
!"𝕨⊏𝕩: Indexing out-of-bounds (¯24∊𝕨, 4≡≠𝕩)" % %USE evar 1¯24 _evar 44