@@ -1571,23 +1571,18 @@ async def test_storm_lib_list(self):
1571
1571
self .eq (ret , ('bar' , 'baz' , 'foo' ,))
1572
1572
1573
1573
# Sort a few text objects
1574
- q = '$foo=$lib.text( foo) $bar=$lib.text( bar) $baz=$lib.text( baz) $v=($foo, $bar, $baz) $v.sort() return ($v)'
1574
+ q = '$foo=(" foo" ) $bar=(" bar" ) $baz=(" baz" ) $v=($foo, $bar, $baz) $v.sort() return ($v)'
1575
1575
ret = await core .callStorm (q )
1576
1576
self .eq (ret , ('bar' , 'baz' , 'foo' ,))
1577
1577
1578
1578
# incompatible sort types
1579
1579
with self .raises (s_exc .StormRuntimeError ):
1580
1580
await core .callStorm ('$v=(foo,bar,(1)) $v.sort() return ($v)' )
1581
1581
1582
- # mix Prims and heavy objects
1583
- with self .raises (s_exc .StormRuntimeError ):
1584
- q = '$foo=$lib.text(foo) $bar=$lib.text(bar) $v=($foo, aString, $bar,) $v.sort() return ($v)'
1585
- await core .callStorm (q )
1586
-
1587
1582
q = '$l = (1, 2, (3), 4, 1, (3), 3, asdf) return ( $l.unique() )'
1588
1583
self .eq (['1' , '2' , 3 , '4' , '3' , 'asdf' ], await core .callStorm (q ))
1589
1584
1590
- q = '$a=$lib.text( hehe) $b=$lib.text( haha) $c=$lib.text( hehe) $foo=($a, $b, $c) return ($foo.unique())'
1585
+ q = '$a=(" hehe" ) $b=(" haha" ) $c=(" hehe" ) $foo=($a, $b, $c) return ($foo.unique())'
1591
1586
self .eq (['hehe' , 'haha' ], await core .callStorm (q ))
1592
1587
1593
1588
await core .addUser ('lowuser1' )
@@ -1805,13 +1800,13 @@ async def test_storm_csv(self):
1805
1800
async def test_storm_text (self ):
1806
1801
async with self .getTestCore () as core :
1807
1802
nodes = await core .nodes ('''
1808
- [ test:int=10 ] $text=$lib. text(hehe) { +test:int>=10 $text.add (haha) }
1809
- [ test:str=$text .str( ) ] +test:str''' )
1803
+ [ test:int=10 ] $text=() $ text.append (hehe) { +test:int>=10 $text.append (haha) }
1804
+ [ test:str=$lib .str.join('', $text ) ] +test:str''' )
1810
1805
self .len (1 , nodes )
1811
1806
self .eq (nodes [0 ].ndef , ('test:str' , 'hehehaha' ))
1812
1807
1813
- q = '''$t=$lib.text (beepboop) $lib.print($lib.len($t ))
1814
- $t.add ("more!") $lib.print($lib.len($t ))
1808
+ q = '''$t=() $t.append (beepboop) $lib.print($lib.len($lib.str.join('',$t) ))
1809
+ $t.append ("more!") $lib.print($lib.len($lib.str.join('',$t) ))
1815
1810
'''
1816
1811
msgs = await core .stormlist (q )
1817
1812
self .stormIsInPrint ('8' , msgs )
@@ -2216,7 +2211,7 @@ def __eq__(self, othr):
2216
2211
2217
2212
# text
2218
2213
q = '''
2219
- $text = $lib. text(beepboopgetthejedi)
2214
+ $text = () $ text.append (beepboopgetthejedi)
2220
2215
$set = $lib.set($text)
2221
2216
'''
2222
2217
msgs = await core .stormlist (q )
@@ -3431,8 +3426,6 @@ async def test_storm_lib_vars_type(self):
3431
3426
self .eq ('telepath:proxy:method' , await core .callStorm ('return( $lib.vars.type($lib.telepath.open($url).getCellInfo) )' , opts ))
3432
3427
self .eq ('telepath:proxy:genrmethod' , await core .callStorm ('return( $lib.vars.type($lib.telepath.open($url).storm) )' , opts ))
3433
3428
3434
- self .eq ('text' , await core .callStorm ('return ( $lib.vars.type($lib.text(hehe)) )' ))
3435
-
3436
3429
self .eq ('node' , await core .callStorm ('[test:str=foo] return ($lib.vars.type($node))' ))
3437
3430
self .eq ('node:props' , await core .callStorm ('[test:str=foo] return ($lib.vars.type($node.props))' ))
3438
3431
self .eq ('node:data' , await core .callStorm ('[test:str=foo] return ($lib.vars.type($node.data))' ))
0 commit comments