quickjs-tart

quickjs-based runtime for wallet-core logic
Log | Files | Refs | README | LICENSE

test1664 (7291B)


      1 <testcase>
      2 <info>
      3 <keywords>
      4 unittest
      5 strparse
      6 </keywords>
      7 </info>
      8 
      9 #
     10 # Client-side
     11 <client>
     12 <server>
     13 none
     14 </server>
     15 <features>
     16 unittest
     17 large-size
     18 </features>
     19 <name>
     20 unit tests for strparse.c string parsing functions
     21 </name>
     22 </client>
     23 
     24 <verify>
     25 <stdout>
     26 curlx_str_word
     27 0: ("word") 0, "word" [4], line 4
     28 1: ("word ") 0, "word" [4], line 4
     29 2: (" word ") 2, "" [0], line 0
     30 3: ("wo rd") 0, "wo" [2], line 2
     31 4: ("word(") 0, "word(" [5], line 5
     32 5: ("wor(d") 0, "wor(d" [5], line 5
     33 6: ("perfect") 0, "perfect" [7], line 7
     34 7: ("") 2, "" [0], line 0
     35 8: ("longerth") 1, "" [0], line 0
     36 curlx_str_until
     37 0: ("word") 0, "wor" [3], line 3
     38 1: ("word ") 0, "wor" [3], line 3
     39 2: (" word ") 0, " wor" [4], line 4
     40 3: ("wo rd") 0, "wo r" [4], line 4
     41 4: ("word(") 0, "wor" [3], line 3
     42 5: ("wor(d") 0, "wor(" [4], line 4
     43 6: ("perfect") 0, "perfect" [7], line 7
     44 7: ("") 2, "" [0], line 0
     45 8: ("longerth") 1, "" [0], line 0
     46 curlx_str_quotedword
     47 0: (""word"") 0, "word" [4], line 6
     48 1: (""word") 4, "" [0], line 0
     49 2: ("word"") 3, "" [0], line 0
     50 3: (""word""") 0, "word" [4], line 6
     51 4: (""word" ") 0, "word" [4], line 6
     52 5: (" "word"") 3, "" [0], line 0
     53 6: (""perfect"") 0, "perfect" [7], line 9
     54 7: (""p r e t"") 0, "p r e t" [7], line 9
     55 8: (""perfec\"") 0, "perfec\" [7], line 9
     56 9: ("""") 0, "" [0], line 2
     57 10: ("") 3, "" [0], line 0
     58 11: (""longerth"") 1, "" [0], line 0
     59 curlx_str_single
     60 0: ("a") 0, line 1
     61 1: ("aa") 0, line 1
     62 2: ("A") 5, line 0
     63 3: ("b") 5, line 0
     64 4: ("\") 5, line 0
     65 5: (" ") 5, line 0
     66 6: ("") 5, line 0
     67 curlx_str_singlespace
     68 0: ("a") 5, line 0
     69 1: ("aa") 5, line 0
     70 2: ("A") 5, line 0
     71 3: ("b") 5, line 0
     72 4: ("\") 5, line 0
     73 5: (" ") 0, line 1
     74 6: ("	") 5, line 0
     75 7: ("
     76 ") 5, line 0
     77 8: ("") 5, line 0
     78 curlx_str_single
     79 0: ("a") 0, line 1
     80 1: ("aa") 0, line 1
     81 2: ("A") 5, line 0
     82 3: ("b") 5, line 0
     83 4: ("\") 5, line 0
     84 5: (" ") 5, line 0
     85 6: ("") 5, line 0
     86 curlx_str_number
     87 0: ("1") 0, [1] line 1
     88 1: ("10000") 7, [0] line 0
     89 2: ("1234") 0, [1234] line 4
     90 3: ("1235") 0, [1235] line 4
     91 4: ("1236") 7, [0] line 0
     92 5: ("01234") 0, [1234] line 5
     93 6: ("00000000000000000000000000001234") 0, [1234] line 32
     94 7: ("0123 345") 0, [123] line 4
     95 8: ("0123O345") 0, [123] line 4
     96 9: ("-12") 8, [0] line 0
     97 10: (" 123") 8, [0] line 0
     98 11: ("") 8, [0] line 0
     99 curlx_str_number varying max
    100 0: ("00") max 8 == 0, [0]
    101 1: ("1") max 8 == 0, [1]
    102 2: ("1") max 1 == 0, [1]
    103 3: ("2") max 1 == 7, [0]
    104 4: ("2") max 2 == 0, [2]
    105 5: ("5") max 6 == 0, [5]
    106 6: ("000000000000000000000006") max 6 == 0, [6]
    107 7: ("7") max 6 == 7, [0]
    108 8: ("8") max 6 == 7, [0]
    109 9: ("9") max 8 == 7, [0]
    110 10: ("10") max 10 == 0, [10]
    111 11: ("11") max 10 == 7, [0]
    112 12: ("12") max 10 == 7, [0]
    113 curlx_str_hex varying max
    114 0: ("00") max 8 == 0, [0]
    115 1: ("1") max 8 == 0, [1]
    116 2: ("1") max 1 == 0, [1]
    117 3: ("2") max 1 == 7, [0]
    118 4: ("2") max 2 == 0, [2]
    119 5: ("5") max 6 == 0, [5]
    120 6: ("000000000000000000000006") max 6 == 0, [6]
    121 7: ("7") max 6 == 7, [0]
    122 8: ("8") max 6 == 7, [0]
    123 9: ("9") max 8 == 7, [0]
    124 10: ("a") max 14 == 0, [10]
    125 11: ("b") max 14 == 0, [11]
    126 12: ("c") max 14 == 0, [12]
    127 13: ("d") max 14 == 0, [13]
    128 14: ("e") max 14 == 0, [14]
    129 15: ("f") max 14 == 7, [0]
    130 16: ("f") max 15 == 0, [15]
    131 17: ("10") max 16 == 0, [16]
    132 18: ("11") max 16 == 7, [0]
    133 19: ("12") max 16 == 7, [0]
    134 curlx_str_octal varying max
    135 0: ("00") max 4 == 0, [0]
    136 1: ("1") max 4 == 0, [1]
    137 2: ("1") max 4 == 0, [1]
    138 3: ("2") max 4 == 0, [2]
    139 4: ("3") max 4 == 0, [3]
    140 5: ("4") max 4 == 0, [4]
    141 6: ("5") max 4 == 7, [0]
    142 7: ("000000000000000000000006") max 6 == 0, [6]
    143 8: ("7") max 7 == 0, [7]
    144 9: ("10") max 8 == 0, [8]
    145 10: ("11") max 8 == 7, [0]
    146 11: ("11") max 9 == 0, [9]
    147 12: ("12") max 9 == 7, [0]
    148 13: ("13") max 9 == 7, [0]
    149 14: ("8") max 10 == 8, [0]
    150 curlx_str_number / max
    151 0: ("9223372036854775807") 0, [9223372036854775807] line 19
    152 1: ("9223372036854775808") 7, [0] line 0
    153 2: ("18446744073709551615") 7, [0] line 0
    154 3: ("18446744073709551616") 7, [0] line 0
    155 4: ("18446744073709551617") 7, [0] line 0
    156 5: ("0123456799a") 0, [123456799] line 10
    157 6: ("0123456789") 0, [123456789] line 10
    158 7: ("123498760b") 0, [123498760] line 9
    159 8: ("1234987607611298232") 0, [1234987607611298232] line 19
    160 9: ("1111111111111111111") 0, [1111111111111111111] line 19
    161 10: ("2222222222222222222") 0, [2222222222222222222] line 19
    162 11: ("00000000000000000000000000000009223372036854775807") 0, [9223372036854775807] line 50
    163 12: ("3333333333333333333") 0, [3333333333333333333] line 19
    164 13: ("4444444444444444444") 0, [4444444444444444444] line 19
    165 14: ("5555555555555555555") 0, [5555555555555555555] line 19
    166 15: ("6666666666666666666") 0, [6666666666666666666] line 19
    167 16: ("7777777777777777777") 0, [7777777777777777777] line 19
    168 17: ("8888888888888888888") 0, [8888888888888888888] line 19
    169 18: ("999999999999999999") 0, [999999999999999999] line 18
    170 curlx_str_newline
    171 0: (%61) 6, line 0
    172 1: (%61) 6, line 0
    173 2: (%41) 6, line 0
    174 3: (%62) 6, line 0
    175 4: (%5c) 6, line 0
    176 5: (%20) 6, line 0
    177 6: (%0a) 0, line 1
    178 7: (%0d) 0, line 1
    179 8: (%0d) 0, line 1
    180 9: (%0c) 6, line 0
    181 10: (%00) 6, line 0
    182 curlx_str_hex
    183 0: ("1") 0, [1] line 1
    184 1: ("1000") 0, [4096] line 4
    185 2: ("1234") 0, [4660] line 4
    186 3: ("1235") 0, [4661] line 4
    187 4: ("1236") 7, [0] line 0
    188 5: ("01234") 0, [4660] line 5
    189 6: ("00000000000000000000000000001234") 0, [4660] line 32
    190 7: ("0123 345") 0, [291] line 4
    191 8: ("0123O345") 0, [291] line 4
    192 9: ("-12") 8, [0] line 0
    193 10: (" 123") 8, [0] line 0
    194 11: ("") 8, [0] line 0
    195 curlx_str_octal
    196 0: ("1") 0, [1] line 1
    197 1: ("1000") 0, [512] line 4
    198 2: ("1234") 0, [668] line 4
    199 3: ("1235") 0, [669] line 4
    200 4: ("1236") 7, [0] line 0
    201 5: ("01234") 0, [668] line 5
    202 6: ("00000000000000000000000000001234") 0, [668] line 32
    203 7: ("0123 345") 0, [83] line 4
    204 8: ("0123O345") 0, [83] line 4
    205 9: ("-12") 8, [0] line 0
    206 10: (" 123") 8, [0] line 0
    207 11: ("") 8, [0] line 0
    208 curlx_str_octal / max
    209 0: ("777777777777777777777") 0, [9223372036854775807] line 21
    210 1: ("1000000000000000000000") 7, [0] line 0
    211 2: ("111111111111111111111") 0, [1317624576693539401] line 21
    212 3: ("222222222222222222222") 0, [2635249153387078802] line 21
    213 4: ("333333333333333333333") 0, [3952873730080618203] line 21
    214 5: ("444444444444444444444") 0, [5270498306774157604] line 21
    215 6: ("555555555555555555555") 0, [6588122883467697005] line 21
    216 7: ("666666666666666666666") 0, [7905747460161236406] line 21
    217 curlx_str_hex / max
    218 0: ("7FFFFFFFFFFFFFFF") 0, [9223372036854775807] line 16
    219 1: ("8000000000000000") 7, [0] line 0
    220 2: ("1111111111111111") 0, [1229782938247303441] line 16
    221 3: ("2222222222222222") 0, [2459565876494606882] line 16
    222 4: ("3333333333333333") 0, [3689348814741910323] line 16
    223 5: ("4444444444444444") 0, [4919131752989213764] line 16
    224 6: ("5555555555555555") 0, [6148914691236517205] line 16
    225 7: ("6666666666666666") 0, [7378697629483820646] line 16
    226 8: ("7777777777777777") 0, [8608480567731124087] line 16
    227 9: ("888888888888888") 0, [614891469123651720] line 15
    228 10: ("999999999999999") 0, [691752902764108185] line 15
    229 11: ("aaaaaaaaAAAAAAA") 0, [768614336404564650] line 15
    230 12: ("bbbbbbbbBBBBBBB") 0, [845475770045021115] line 15
    231 13: ("BBBBBBBBbbbbbbb") 0, [845475770045021115] line 15
    232 14: ("ccccccccCCCCCCC") 0, [922337203685477580] line 15
    233 15: ("ddddddddDDDDDDD") 0, [999198637325934045] line 15
    234 16: ("eeeeeeeeEEEEEEE") 0, [1076060070966390510] line 15
    235 17: ("ffffffffFFFFFFF") 0, [1152921504606846975] line 15
    236 18: ("abcdef") 0, [11259375] line 6
    237 19: ("ABCDEF") 0, [11259375] line 6
    238 </stdout>
    239 </verify>
    240 </testcase>