scripting.js.EXPECTED revision 6:5a1b0714df0e
1a normal string 2line 0 3line 1 4Here is a long sentence 5that may extend over 3 6lines.!!!! 7Here is a long sentence 8that may extend over 4 9lines. 10!!!! 11This is executed how 12 <html> 13 <head> 14 <title>Testing</title> 15 </head> 16 <body> 17 <p>This is a test.<p> 18 </body> 19 </html> 208 21No we don't 22/* 23 * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. 24 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 25 * 26 * This code is free software; you can redistribute it and/or modify it 27 * under the terms of the GNU General Public License version 2 only, as 28 * published by the Free Software Foundation. 29 * 30 * This code is distributed in the hope that it will be useful, but WITHOUT 31 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 32 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 33 * version 2 for more details (a copy is included in the LICENSE file that 34 * accompanied this code). 35 * 36 * You should have received a copy of the GNU General Public License version 37 * 2 along with this work; if not, write to the Free Software Foundation, 38 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 39 * 40 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 41 * or visit www.oracle.com if you need additional information or have any 42 * questions. 43 */ 44 45/** 46 * Edit strings test 47 * 48 * @test 49 * @option -scripting 50 * @run 51 */ 52 53# scripting mode - shell style line comment works.. 54 55var t = "normal"; 56print("a ${t} string"); 57 58// JavaScript style line comment works too.. 59var i = 0; 60print("line ${i++}\nline ${i++}"); 61 62var c = 3; 63print(<<EOD + "!!!!") 64Here is a long sentence 65that may extend over ${c} 66lines. 67EOD 68 69c = 4; 70print(<<<EOD + "!!!!") 71Here is a long sentence 72that may extend over ${c} 73lines. 74EOD 75 76eval(<<BRAINTEASER); 77print("This is executed how"); 78BRAINTEASER 79 80print(<<HTML); 81 <html> 82 <head> 83 <title>Testing</title> 84 </head> 85 <body> 86 <p>This is a test.<p> 87 </body> 88 </html> 89HTML 90 91var x = 1 92<< 933; 94print(x); 95 96var y = <<EOD; 97There we go 98EOD y = "No we don't"; 99print(y); 100 101 102print(read(__FILE__)); 103 104