home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / historic / v941.tgz / icon.v941src.tar / icon.v941src / tests / general / string.std < prev    next >
Text File  |  2001-05-02  |  3KB  |  216 lines

  1.  ----> &null
  2. s := "abcd" ----> "abcd"
  3. s := "x" ----> "x"
  4. s ||:= "x" ----> "xx"
  5. s ----> "xx"
  6. s := "x" ----> "x"
  7. s ||:= "xx" ----> "xxx"
  8. s ----> "xxx"
  9. s := "x" ----> "x"
  10. s ||:= "X" ----> "xX"
  11. s ----> "xX"
  12. s := "x" ----> "x"
  13. s ||:= "abc" ----> "xabc"
  14. s ----> "xabc"
  15. s := "x" ----> "x"
  16. s ==:= "x" ----> "x"
  17. s ----> "x"
  18. s := "x" ----> "x"
  19. s ==:= "xx" ----> none
  20. s ----> "x"
  21. s := "x" ----> "x"
  22. s ==:= "X" ----> none
  23. s ----> "x"
  24. s := "x" ----> "x"
  25. s ==:= "abc" ----> none
  26. s ----> "x"
  27. {s[1:2] := "xx";s} ----> "xx"
  28. {s[-1:0] := "";s} ----> "x"
  29. {s[1] := "abc";s} ----> "abc"
  30. {s[1+:2] := "y";s} ----> "yc"
  31. {s[2] :=: s[3];s} ----> "yc"
  32. s[6] := "t" ----> none
  33. s[0-:6] := "u" ----> none
  34. {s[1:0] :=: s[0:1];s} ----> "yc"
  35. "x" << "x" ----> none
  36. "x" << "X" ----> none
  37. "X" << "x" ----> "x"
  38. "xx" <<= "xx" ----> "xx"
  39. "xxx" <<= "xx" ----> none
  40. "xx" <<= "xxx" ----> "xxx"
  41. "x" >>= "x" ----> "x"
  42. "x" >>= "xx" ----> none
  43. "xx" >>= "x" ----> "x"
  44. "x" >> "x" ----> none
  45. "x" >> "X" ----> "X"
  46. "X" >> "x" ----> none
  47. "x" == "x" ----> "x"
  48. "x" == "X" ----> none
  49. "X" == "x" ----> none
  50. "x" ~== "x" ----> none
  51. "x" ~== "X" ----> "X"
  52. "X" ~== "x" ----> "x"
  53. 2
  54. 22
  55. 222
  56. 2222
  57. 22222
  58. 222222
  59. 2222222
  60. 22222222
  61. 222222222
  62. every i := 1 to 9 do write(integer(repl("2",i))) ----> none
  63. 3
  64. 23
  65. 223
  66. 2223
  67. 22223
  68. 222223
  69. 2222223
  70. 22222223
  71. 222222223
  72. every i := 1 to 9 do write(repl("2",i) + 1) ----> none
  73. 2
  74. 2
  75. 2
  76. 2
  77. 2
  78. 2
  79. 2
  80. 2
  81. 2
  82. 2
  83. 2
  84. 2
  85. 2
  86. 2
  87. 2
  88. 2
  89. 2
  90. 2
  91. 2
  92. 2
  93. 2
  94. 2
  95. 2
  96. 2
  97. 2
  98. 2
  99. 2
  100. 2
  101. 2
  102. 2
  103. every i := 1 to 30 do write(integer(repl("0",i) || "2")) ----> none
  104. 3
  105. 3
  106. 3
  107. 3
  108. 3
  109. 3
  110. 3
  111. 3
  112. 3
  113. 3
  114. 3
  115. 3
  116. 3
  117. 3
  118. 3
  119. 3
  120. 3
  121. 3
  122. 3
  123. 3
  124. 3
  125. 3
  126. 3
  127. 3
  128. 3
  129. 3
  130. 3
  131. 3
  132. 3
  133. 3
  134. every i := 1 to 30 do write((repl("0",i) || "2") + 1) ----> none
  135. c1 := 'abcde' ----> 'abcde'
  136. c2 := 'aeuoi' ----> 'aeiou'
  137. c1 ++ c2 ----> 'abcdeiou'
  138. c1 -- c2 ----> 'bcd'
  139. c1 ** c2 ----> 'ae'
  140. 2 ~=== +2 ----> none
  141. 3 ~=== *"abc" ----> none
  142. 'abc' ~=== ('abc' ++ '') ----> none
  143. any('aeiou',&lcase) ----> 2
  144. any('aeiou',&ucase) ----> none
  145. 2
  146. 2
  147. 2
  148. 2
  149. 2
  150. 2
  151. 2
  152. 2
  153. 2
  154. 2
  155. 2
  156. 6
  157. 6
  158. 6
  159. 6
  160. 6
  161. 6
  162. 6
  163. 6
  164. 6
  165. 6
  166. 6
  167. every write(any('aeiou',&lcase,1 to 5,10 to 20)) ----> none
  168. match("abc","abcabcabcabc") ----> 4
  169. match("abc","xabcabcabcabc") ----> none
  170. 5
  171. 5
  172. 5
  173. 5
  174. 5
  175. 5
  176. 5
  177. 8
  178. 8
  179. 8
  180. 5
  181. 5
  182. 5
  183. 8
  184. 5
  185. 8
  186. 5
  187. 8
  188. every write(match("abc","xabcabcabcabc",1 to 10,1 to 10)) ----> none
  189. upto('56d&',&lcase) ----> 4
  190. upto('56d&',&ucase) ----> none
  191. upto('56d&',&lcase,15) ----> none
  192. many(&lcase,"this is a Test") ----> 5
  193. many(&lcase,"this is a Test",5) ----> none
  194. many(&lcase,"this is a Test",5,9) ----> none
  195. find("aa","xxaaaaaa") ----> 3
  196. 3
  197. 4
  198. 5
  199. 6
  200. 7
  201. every write(find("aa","xxaaaaaa")) ----> none
  202. 4
  203. 5
  204. every write(find("aa","xxaaaaaa",4,7)) ----> none
  205. bal('-','(',')',"-35") ----> 1
  206. bal('+','(',')',"((2*x)+3)+(5*y)") ----> 10
  207. 10
  208. 7
  209. 7
  210. 10
  211. every write(bal('+','(',')',"((2*x)+3)+(5*y)",1 to 10)) ----> none
  212. bal('+','[','[',"[[2*x[+3[+[5*y[") ----> none
  213. bal('+','([','])',"([2*x)+3]+(5*y]") ----> 10
  214. bal(,,,"()+()") ----> 1
  215. bal(&cset,,,"()+()") ----> 1
  216.