1 # Copyright 2013 the V8 project authors. All rights reserved. 2 # Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 3 # 4 # Redistribution and use in source and binary forms, with or without 5 # modification, are permitted provided that the following conditions 6 # are met: 7 # 1. Redistributions of source code must retain the above copyright 8 # notice, this list of conditions and the following disclaimer. 9 # 2. Redistributions in binary form must reproduce the above copyright 10 # notice, this list of conditions and the following disclaimer in the 11 # documentation and/or other materials provided with the distribution. 12 # 13 # THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY 14 # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 15 # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 16 # DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY 17 # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 18 # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 19 # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 20 # ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 21 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 22 # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 24 Tests that ToString on a possible-non-cell value works. 25 26 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". 27 28 29 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,42" 30 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,hello" 31 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,42" 32 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,hello" 33 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,42" 34 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,hello" 35 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,42" 36 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,hello" 37 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,42" 38 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,hello" 39 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,42" 40 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,hello" 41 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,42" 42 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,hello" 43 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,42" 44 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,hello" 45 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,42" 46 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,hello" 47 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,42" 48 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,hello" 49 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,42" 50 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,hello" 51 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,42" 52 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,hello" 53 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,42" 54 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,hello" 55 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,42" 56 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,hello" 57 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,42" 58 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,hello" 59 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,42" 60 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,hello" 61 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,42" 62 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,hello" 63 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,42" 64 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,hello" 65 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,42" 66 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,hello" 67 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,42" 68 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,hello" 69 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,42" 70 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,hello" 71 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,42" 72 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,hello" 73 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,42" 74 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,hello" 75 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,42" 76 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,hello" 77 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,42" 78 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,hello" 79 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,42" 80 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,hello" 81 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,42" 82 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,hello" 83 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,42" 84 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,hello" 85 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,42" 86 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,hello" 87 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,42" 88 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,hello" 89 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,42" 90 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,hello" 91 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,42" 92 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,hello" 93 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,42" 94 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,hello" 95 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,42" 96 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,hello" 97 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,42" 98 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,hello" 99 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,42" 100 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,hello" 101 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,42" 102 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,hello" 103 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,42" 104 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,hello" 105 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,42" 106 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,hello" 107 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,42" 108 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,hello" 109 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,42" 110 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,hello" 111 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,42" 112 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,hello" 113 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,42" 114 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,hello" 115 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,42" 116 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,hello" 117 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,42" 118 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,hello" 119 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,42" 120 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,hello" 121 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,42" 122 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,hello" 123 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,42" 124 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,hello" 125 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,42" 126 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,hello" 127 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,42" 128 PASS "" + foo("foo", i % 2 ? "hello" : 42) is "foo,hello" 129 PASS successfullyParsed is true 130 131 TEST COMPLETE 132 133