Files
kichikuou_xsystem35-sdl2/test/strvar.adv
T
kichikuou 8fac291e84 Fix MF command
It should return the number of characters from the start index, not from
the beginning of the string.
2022-06-18 22:05:45 +09:00

196 lines
4.0 KiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
MS FILE,"strvar.adv":
!len:0!
!src:0!
!dst:0!
const word str1 = 10:
const word str2 = 11:
const word str3 = 12:
const word str4 = 13:
const word str5 = 14:
MS str1,"0123456789":
ML len,str1:
~AssertEquals len,10,__LINE__:
MD str2,str1,5:
MS str3,"01234":
~AssertStrEquals str2,str3,__LINE__:
ME str2,2,str1,6,2:
MS str3,"0167":
~AssertStrEquals str2,str3,__LINE__:
MS str1,"0123456789":
ML len,str1:
~AssertEquals len,10,__LINE__:
MD str2,str1,5:
MS str3,"01234":
~AssertStrEquals str2,str3,__LINE__:
ME str2,2,str1,6,2:
MS str3,"0167":
~AssertStrEquals str2,str3,__LINE__:
MS str1,"<0x82a0>a":
MN 0,str1,D01:
~AssertEquals RND,3,__LINE__:
~AssertEquals D01,0xa082,__LINE__:
~AssertEquals D02,0x61,__LINE__: ; 'a' == "\x61"
~AssertEquals D03,0,__LINE__:
!D01:0xa182!
inc D02:
MN 1,str1,D01:
MS str2,"<0x82a1>b":
~AssertStrEquals str1,str2,__LINE__:
MS str1,"あいうabc123":
MS str2,"c":
MF D01,str1,str2,0:
~AssertEquals RND,0,__LINE__:
~AssertEquals D01,5,__LINE__:
MF D01,str1,str2,4:
~AssertEquals RND,0,__LINE__:
~AssertEquals D01,1,__LINE__:
MF D01,str1,str2,5:
~AssertEquals RND,0,__LINE__:
~AssertEquals D01,0,__LINE__:
MF D01,str1,str2,6:
~AssertEquals RND,255,__LINE__:
MS str2,"":
MF D01,str1,str2,0:
~AssertEquals RND,0,__LINE__:
~AssertEquals D01,0,__LINE__:
MH str1,0,0:
MS str2,"":
~AssertStrEquals str1,str2,__LINE__:
MH str1,0,12345:
MS str2,"12345":
~AssertStrEquals str1,str2,__LINE__:
MH str1,3,12345:
MS str2,"345":
~AssertStrEquals str1,str2,__LINE__:
MH str1,6,12345:
MS str2," 12345":
~AssertStrEquals str1,str2,__LINE__:
MHH str1,0,0:
MS str2,"0":
~AssertStrEquals str1,str2,__LINE__:
MHH str1,0,12345:
MS str2,"12345":
~AssertStrEquals str1,str2,__LINE__:
MHH str1,3,12345:
MS str2,"345":
~AssertStrEquals str1,str2,__LINE__:
MHH str1,6,12345:
MS str2," 12345":
~AssertStrEquals str1,str2,__LINE__:
MS str1,"123あいう":
~MPtoString str2,str1,5:
MS str3,"123あい":
~AssertStrEquals str2,str3,__LINE__:
~MPtoString str2,str1,8:
MS str3,"123あいう  ":
~AssertStrEquals str2,str3,__LINE__:
MS str2,"0123456789":
MM str1,str2:
~AssertStrEquals str1,str2,__LINE__:
<D01,20,500,1,10:
MA str1,str2:
ML len,str1:
~AssertEquals len,D01,__LINE__:
>
\test_MG7:
\test_strFuncs:
\test_ShString:
%0:
*test_MG7:
MG 100,0:
MG 1,str1:
MG 4,0:
MG 0,1:
'123あいう'
MG 0,0:
MG 100,1:
MG 7,len:
~AssertEquals len,6,__LINE__:
\0:
*test_strFuncs:
MS str1,"":
MS str2,"あいう":
MS str3,"abc":
MS str4,"abcあいう":
strCheckASCII str1,RND:
~AssertEquals RND,0,__LINE__:
strCheckASCII str2,RND:
~AssertEquals RND,0,__LINE__:
strCheckASCII str3,RND:
~AssertEquals RND,1,__LINE__:
strCheckASCII str4,RND:
~AssertEquals RND,1,__LINE__:
strCheckSJIS str1,RND:
~AssertEquals RND,0,__LINE__:
strCheckSJIS str2,RND:
~AssertEquals RND,1,__LINE__:
strCheckSJIS str3,RND:
~AssertEquals RND,0,__LINE__:
strCheckSJIS str4,RND:
~AssertEquals RND,1,__LINE__:
strGetCharType str4,0,RND:
~AssertEquals RND,1,__LINE__:
strGetCharType str4,3,RND:
~AssertEquals RND,2,__LINE__:
strGetCharType str4,6,RND:
~AssertEquals RND,0,__LINE__:
strGetLengthASCII str1,RND:
~AssertEquals RND,0,__LINE__:
strGetLengthASCII str2,RND:
~AssertEquals RND,6,__LINE__:
strGetLengthASCII str3,RND:
~AssertEquals RND,3,__LINE__:
strGetLengthASCII str4,RND:
~AssertEquals RND,9,__LINE__:
\0:
*test_ShString:
MS str1,"あああああ":
MS str2,"ああ":
MS str3,"いいい":
ShString.ExchangeString str1,str2,str3:
MS str4,"いいいいいいあ":
~AssertStrEquals str1,str4,__LINE__:
MS str1,"a":
MS str2,"b":
MS str3,"c":
MS str4,"d":
ShString.FillString str1,3,str2:
MS str5,"b":
~AssertStrEquals str1,str5,__LINE__:
~AssertStrEquals str2,str5,__LINE__:
~AssertStrEquals str3,str5,__LINE__:
MS str5,"d":
~AssertStrEquals str4,str5,__LINE__:
\0:
**MPtoString dst,src,len:
MG 100,0:
MG 1,dst:
MG 4,0:
MG 0,1:
MP src,len:
MG 0,0:
MG 100,1:
%0: