nashorn/test/script/currently-failing/JDK-8006191.js
author psandoz
Tue, 13 Aug 2013 11:16:37 +0200
changeset 19424 c4524285927f
parent 16213 66cb726a76d5
child 24778 2ff5d7041566
permissions -rw-r--r--
8022797: Clarify spliterator characteristics for collections containing no elements Reviewed-by: alanb, mduigou
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
16211
41e031a45186 8006191: `cmd` -> exec("cmd") in script mode
jlaskey
parents:
diff changeset
     1
/*
41e031a45186 8006191: `cmd` -> exec("cmd") in script mode
jlaskey
parents:
diff changeset
     2
 * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
41e031a45186 8006191: `cmd` -> exec("cmd") in script mode
jlaskey
parents:
diff changeset
     3
 * 
41e031a45186 8006191: `cmd` -> exec("cmd") in script mode
jlaskey
parents:
diff changeset
     4
 * Redistribution and use in source and binary forms, with or without
41e031a45186 8006191: `cmd` -> exec("cmd") in script mode
jlaskey
parents:
diff changeset
     5
 * modification, are permitted provided that the following conditions
41e031a45186 8006191: `cmd` -> exec("cmd") in script mode
jlaskey
parents:
diff changeset
     6
 * are met:
41e031a45186 8006191: `cmd` -> exec("cmd") in script mode
jlaskey
parents:
diff changeset
     7
 * 
41e031a45186 8006191: `cmd` -> exec("cmd") in script mode
jlaskey
parents:
diff changeset
     8
 *   - Redistributions of source code must retain the above copyright
41e031a45186 8006191: `cmd` -> exec("cmd") in script mode
jlaskey
parents:
diff changeset
     9
 *     notice, this list of conditions and the following disclaimer.
41e031a45186 8006191: `cmd` -> exec("cmd") in script mode
jlaskey
parents:
diff changeset
    10
 * 
41e031a45186 8006191: `cmd` -> exec("cmd") in script mode
jlaskey
parents:
diff changeset
    11
 *   - Redistributions in binary form must reproduce the above copyright
41e031a45186 8006191: `cmd` -> exec("cmd") in script mode
jlaskey
parents:
diff changeset
    12
 *     notice, this list of conditions and the following disclaimer in the
41e031a45186 8006191: `cmd` -> exec("cmd") in script mode
jlaskey
parents:
diff changeset
    13
 *     documentation and/or other materials provided with the distribution.
41e031a45186 8006191: `cmd` -> exec("cmd") in script mode
jlaskey
parents:
diff changeset
    14
 * 
41e031a45186 8006191: `cmd` -> exec("cmd") in script mode
jlaskey
parents:
diff changeset
    15
 *   - Neither the name of Oracle nor the names of its
41e031a45186 8006191: `cmd` -> exec("cmd") in script mode
jlaskey
parents:
diff changeset
    16
 *     contributors may be used to endorse or promote products derived
41e031a45186 8006191: `cmd` -> exec("cmd") in script mode
jlaskey
parents:
diff changeset
    17
 *     from this software without specific prior written permission.
41e031a45186 8006191: `cmd` -> exec("cmd") in script mode
jlaskey
parents:
diff changeset
    18
 * 
41e031a45186 8006191: `cmd` -> exec("cmd") in script mode
jlaskey
parents:
diff changeset
    19
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
41e031a45186 8006191: `cmd` -> exec("cmd") in script mode
jlaskey
parents:
diff changeset
    20
 * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
41e031a45186 8006191: `cmd` -> exec("cmd") in script mode
jlaskey
parents:
diff changeset
    21
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
41e031a45186 8006191: `cmd` -> exec("cmd") in script mode
jlaskey
parents:
diff changeset
    22
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
41e031a45186 8006191: `cmd` -> exec("cmd") in script mode
jlaskey
parents:
diff changeset
    23
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
41e031a45186 8006191: `cmd` -> exec("cmd") in script mode
jlaskey
parents:
diff changeset
    24
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
41e031a45186 8006191: `cmd` -> exec("cmd") in script mode
jlaskey
parents:
diff changeset
    25
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
41e031a45186 8006191: `cmd` -> exec("cmd") in script mode
jlaskey
parents:
diff changeset
    26
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
41e031a45186 8006191: `cmd` -> exec("cmd") in script mode
jlaskey
parents:
diff changeset
    27
 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
41e031a45186 8006191: `cmd` -> exec("cmd") in script mode
jlaskey
parents:
diff changeset
    28
 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
41e031a45186 8006191: `cmd` -> exec("cmd") in script mode
jlaskey
parents:
diff changeset
    29
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
41e031a45186 8006191: `cmd` -> exec("cmd") in script mode
jlaskey
parents:
diff changeset
    30
 */
41e031a45186 8006191: `cmd` -> exec("cmd") in script mode
jlaskey
parents:
diff changeset
    31
 
41e031a45186 8006191: `cmd` -> exec("cmd") in script mode
jlaskey
parents:
diff changeset
    32
/**
41e031a45186 8006191: `cmd` -> exec("cmd") in script mode
jlaskey
parents:
diff changeset
    33
 * JDK-8006191 - `cmd` -> exec("cmd") in script mode
41e031a45186 8006191: `cmd` -> exec("cmd") in script mode
jlaskey
parents:
diff changeset
    34
 *
41e031a45186 8006191: `cmd` -> exec("cmd") in script mode
jlaskey
parents:
diff changeset
    35
 * @test
41e031a45186 8006191: `cmd` -> exec("cmd") in script mode
jlaskey
parents:
diff changeset
    36
 * @option -scripting
41e031a45186 8006191: `cmd` -> exec("cmd") in script mode
jlaskey
parents:
diff changeset
    37
 * @argument ArgumentFromCommandLine
41e031a45186 8006191: `cmd` -> exec("cmd") in script mode
jlaskey
parents:
diff changeset
    38
 * @run 
41e031a45186 8006191: `cmd` -> exec("cmd") in script mode
jlaskey
parents:
diff changeset
    39
 */
41e031a45186 8006191: `cmd` -> exec("cmd") in script mode
jlaskey
parents:
diff changeset
    40
41e031a45186 8006191: `cmd` -> exec("cmd") in script mode
jlaskey
parents:
diff changeset
    41
#!/usr/bin/jjs
41e031a45186 8006191: `cmd` -> exec("cmd") in script mode
jlaskey
parents:
diff changeset
    42
41e031a45186 8006191: `cmd` -> exec("cmd") in script mode
jlaskey
parents:
diff changeset
    43
$ENV.PWD = ".";
41e031a45186 8006191: `cmd` -> exec("cmd") in script mode
jlaskey
parents:
diff changeset
    44
print($ENV.PWD);
41e031a45186 8006191: `cmd` -> exec("cmd") in script mode
jlaskey
parents:
diff changeset
    45
41e031a45186 8006191: `cmd` -> exec("cmd") in script mode
jlaskey
parents:
diff changeset
    46
var files = `ls`.trim().split("\n");
41e031a45186 8006191: `cmd` -> exec("cmd") in script mode
jlaskey
parents:
diff changeset
    47
for (var i in files) {
41e031a45186 8006191: `cmd` -> exec("cmd") in script mode
jlaskey
parents:
diff changeset
    48
    var file = files[i];
41e031a45186 8006191: `cmd` -> exec("cmd") in script mode
jlaskey
parents:
diff changeset
    49
    if (file.contains("README")) {
41e031a45186 8006191: `cmd` -> exec("cmd") in script mode
jlaskey
parents:
diff changeset
    50
        print(file);
41e031a45186 8006191: `cmd` -> exec("cmd") in script mode
jlaskey
parents:
diff changeset
    51
    }
41e031a45186 8006191: `cmd` -> exec("cmd") in script mode
jlaskey
parents:
diff changeset
    52
}
41e031a45186 8006191: `cmd` -> exec("cmd") in script mode
jlaskey
parents:
diff changeset
    53
41e031a45186 8006191: `cmd` -> exec("cmd") in script mode
jlaskey
parents:
diff changeset
    54
var result = $EXEC("cat", <<EOD);
41e031a45186 8006191: `cmd` -> exec("cmd") in script mode
jlaskey
parents:
diff changeset
    55
This is a bunch of stuff
41e031a45186 8006191: `cmd` -> exec("cmd") in script mode
jlaskey
parents:
diff changeset
    56
that I want written out
41e031a45186 8006191: `cmd` -> exec("cmd") in script mode
jlaskey
parents:
diff changeset
    57
including ${$ARG[0]}
41e031a45186 8006191: `cmd` -> exec("cmd") in script mode
jlaskey
parents:
diff changeset
    58
EOD
41e031a45186 8006191: `cmd` -> exec("cmd") in script mode
jlaskey
parents:
diff changeset
    59
print(result);
41e031a45186 8006191: `cmd` -> exec("cmd") in script mode
jlaskey
parents:
diff changeset
    60
print($OUT);
41e031a45186 8006191: `cmd` -> exec("cmd") in script mode
jlaskey
parents:
diff changeset
    61
41e031a45186 8006191: `cmd` -> exec("cmd") in script mode
jlaskey
parents:
diff changeset
    62
var arg = "-Q";
41e031a45186 8006191: `cmd` -> exec("cmd") in script mode
jlaskey
parents:
diff changeset
    63
`ls ${arg}`;
41e031a45186 8006191: `cmd` -> exec("cmd") in script mode
jlaskey
parents:
diff changeset
    64
print($ERR);
41e031a45186 8006191: `cmd` -> exec("cmd") in script mode
jlaskey
parents:
diff changeset
    65
print($EXIT);