polserver/testsuite/escript/string/string11.src

25 lines
385 B
Text
Raw Permalink Normal View History

// test modification of a substring after an assignment.
var a := "testvalue";
var b := "value2";
var c := "value";
print( "a="+a );
print( "b="+b );
print( "c="+c );
var d := a["val"];
// This is key: this assignment must not modify 'a'.
d := "hello";
print( "a="+a );
print( "d="+d );
// Now, this one _should_.
a["val"] := "hello";
print( "a="+a );
print( "d="+d );