Remove print calls in sm/String

This commit is contained in:
André Bargull 2025-04-30 14:16:05 +02:00 committed by Philip Chimento
parent 12bc5996c5
commit 232893dbe5
34 changed files with 35 additions and 304 deletions

View File

@ -8,17 +8,9 @@ includes: [sm/non262.js, sm/non262-shell.js]
flags:
- noStrict
description: |
pending
String.prototype.replace with non-regexp searchValue
esid: pending
---*/
var BUGNUMBER = 587366;
var summary = "String.prototype.replace with non-regexp searchValue";
print(BUGNUMBER + ": " + summary);
/**************
* BEGIN TEST *
**************/
/*
* Check that regexp statics are preserved across the whole test.
@ -65,7 +57,3 @@ assert.sameValue(result, 'I once was lost but now am $1found$2.$3.');
/* Check RegExp statics haven't been mutated. */
for (var ident in before)
assert.sameValue(RegExp[ident], before[ident]);
/******************************************************************************/
print("All tests passed!");

View File

@ -8,13 +8,9 @@ includes: [sm/non262.js, sm/non262-shell.js]
flags:
- noStrict
description: |
pending
String.prototype.indexOf with empty searchString
esid: pending
---*/
var BUGNUMBER = 612838;
var summary = "String.prototype.indexOf with empty searchString";
print(BUGNUMBER + ": " + summary);
assert.sameValue("123".indexOf("", -1), 0);
assert.sameValue("123".indexOf("", 0), 0);
@ -22,5 +18,3 @@ assert.sameValue("123".indexOf("", 1), 1);
assert.sameValue("123".indexOf("", 3), 3);
assert.sameValue("123".indexOf("", 4), 3);
assert.sameValue("123".indexOf("", 12345), 3);
print("All tests passed!");

View File

@ -6,13 +6,9 @@ includes: [sm/non262.js, sm/non262-shell.js, compareArray.js]
flags:
- noStrict
description: |
pending
Implement RegExp unicode flag -- AdvanceStringIndex in global match and replace.
esid: pending
---*/
var BUGNUMBER = 1135377;
var summary = "Implement RegExp unicode flag -- AdvanceStringIndex in global match and replace.";
print(BUGNUMBER + ": " + summary);
// ==== String.prototype.match ====
@ -49,4 +45,3 @@ assert.compareArray("\uD83D\uDC38\uD83D\uDC39X\uD83D\uDC3A".split(/\uDC38|X|/u),
["\uD83D\uDC38", "\uD83D\uDC39", "\uD83D\uDC3A"]);
assert.compareArray("\uD83D\uDC38\uD83D\uDC39X\uD83D\uDC3A".split(/\uD83D\uDC38|X|/u),
["", "\uD83D\uDC39", "\uD83D\uDC3A"]);

View File

@ -6,13 +6,9 @@ includes: [sm/non262.js, sm/non262-shell.js]
flags:
- noStrict
description: |
pending
String.prototype.{startsWith,endsWith,includes} should call IsRegExp.
esid: pending
---*/
var BUGNUMBER = 1054755;
var summary = 'String.prototype.{startsWith,endsWith,includes} should call IsRegExp.';
print(BUGNUMBER + ": " + summary);
for (var method of ["startsWith", "endsWith", "includes"]) {
for (var re of [/foo/, new RegExp()]) {
@ -30,4 +26,3 @@ for (var method of ["startsWith", "endsWith", "includes"]) {
"foo"[method]({ [Symbol.match]: v2 });
}
}

View File

@ -6,13 +6,9 @@ includes: [sm/non262.js, sm/non262-shell.js]
flags:
- noStrict
description: |
pending
String.prototype.codePointAt
esid: pending
---*/
var BUGNUMBER = 918879;
var summary = 'String.prototype.codePointAt';
print(BUGNUMBER + ": " + summary);
// Tests taken from:
// https://github.com/mathiasbynens/String.prototype.codePointAt/blob/master/tests/tests.js
@ -91,4 +87,3 @@ assert.throws(TypeError, function() { String.prototype.codePointAt.apply(null, [
assert.sameValue(String.prototype.codePointAt.apply(42, [0]), 0x34);
assert.sameValue(String.prototype.codePointAt.apply(42, [1]), 0x32);
assert.sameValue(String.prototype.codePointAt.apply({ 'toString': function() { return 'abc'; } }, [2]), 0x63);

View File

@ -8,18 +8,9 @@ includes: [sm/non262.js, sm/non262-shell.js]
flags:
- noStrict
description: |
pending
[[DefaultValue]] behavior wrong for String with overridden valueOf/toString
esid: pending
---*/
var BUGNUMBER = 645464;
var summary =
"[[DefaultValue]] behavior wrong for String with overridden valueOf/toString";
print(BUGNUMBER + ": " + summary);
/**************
* BEGIN TEST *
**************/
// equality
@ -168,7 +159,3 @@ function testInOperatorName()
assert.sameValue(s3 in { "": 17 }, true);
}
testInOperatorName();
/******************************************************************************/
print("All tests passed!");

View File

@ -6,13 +6,9 @@ includes: [sm/non262.js, sm/non262-shell.js]
flags:
- noStrict
description: |
pending
String.fromCodePoint
esid: pending
---*/
var BUGNUMBER = 918879;
var summary = 'String.fromCodePoint';
print(BUGNUMBER + ": " + summary);
// Tests taken from:
// https://github.com/mathiasbynens/String.fromCodePoint/blob/master/tests/tests.js
@ -67,4 +63,3 @@ assert.sameValue(String.fromCodePoint(0x31, 0x32, 0x33, 0x34), '1234');
assert.sameValue(String.fromCodePoint(0x31, 0x32, 0x33, 0x34, 0x35), '12345');
// str_fromCodePoint (many arguments, creates a malloc string)
assert.sameValue(String.fromCodePoint(0x31, 0x32, 0x33, 0x34, 0x35, 0x36), '123456');

View File

@ -6,13 +6,9 @@ includes: [sm/non262.js, sm/non262-shell.js]
flags:
- noStrict
description: |
pending
Internal usage of split should not be affected by prototpe change
esid: pending
---*/
var BUGNUMBER = 1268138;
var summary = 'Internal usage of split should not be affected by prototpe change';
print(BUGNUMBER + ": " + summary);
function test() {
var t = 24*60*60*1000;
@ -37,4 +33,3 @@ function test() {
if (this.hasOwnProperty("Intl"))
test();

View File

@ -6,13 +6,9 @@ includes: [sm/non262.js, sm/non262-shell.js, deepEqual.js]
flags:
- noStrict
description: |
pending
String.prototype.match should call GetMethod.
esid: pending
---*/
var BUGNUMBER = 1290655;
var summary = "String.prototype.match should call GetMethod.";
print(BUGNUMBER + ": " + summary);
function create(value) {
return {
@ -35,4 +31,3 @@ for (let v of [null, undefined]) {
for (let v of [1, true, Symbol.iterator, "", {}, []]) {
assert.throws(TypeError, () => "a-a".match(create(v)));
}

View File

@ -8,19 +8,9 @@ includes: [sm/non262.js, sm/non262-shell.js]
flags:
- noStrict
description: |
pending
String.prototype.match must define matches on the returned array, not set them
esid: pending
---*/
var BUGNUMBER = 677820;
var summary =
"String.prototype.match must define matches on the returned array, not set " +
"them";
print(BUGNUMBER + ": " + summary);
/**************
* BEGIN TEST *
**************/
var called = false;
function setterFunction(v) { called = true; }
@ -48,5 +38,3 @@ assert.sameValue(desc.configurable, false);
assert.sameValue([][1], "getter");
assert.sameValue(called, false);
print("Tests complete");

View File

@ -8,25 +8,11 @@ includes: [sm/non262.js, sm/non262-shell.js]
flags:
- noStrict
description: |
pending
String.prototype.match behavior with zero-length matches involving forward lookahead
esid: pending
---*/
var BUGNUMBER = 501739;
var summary =
"String.prototype.match behavior with zero-length matches involving " +
"forward lookahead";
print(BUGNUMBER + ": " + summary);
/**************
* BEGIN TEST *
**************/
var r = /(?=x)/g;
var res = "aaaaaaaaaxaaaaaaaaax".match(r);
assert.sameValue(res.length, 2);
/******************************************************************************/
print("Tests complete");

View File

@ -8,19 +8,9 @@ includes: [sm/non262.js, sm/non262-shell.js]
flags:
- noStrict
description: |
pending
String.prototype.match should throw when called with a global RegExp whose .lastIndex is non-writable
esid: pending
---*/
var BUGNUMBER = 501739;
var summary =
"String.prototype.match should throw when called with a global RegExp " +
"whose .lastIndex is non-writable";
print(BUGNUMBER + ": " + summary);
/**************
* BEGIN TEST *
**************/
var s = '0x2x4x6x8';
@ -87,7 +77,3 @@ catch (e)
assert.sameValue(e instanceof TypeError, true,
"should have thrown a TypeError, instead got: " + e);
}
/******************************************************************************/
print("Tests complete");

View File

@ -8,19 +8,9 @@ includes: [sm/non262.js, sm/non262-shell.js]
flags:
- noStrict
description: |
pending
String.prototype.match should zero the .lastIndex when called with a global RegExp
esid: pending
---*/
var BUGNUMBER = 501739;
var summary =
"String.prototype.match should zero the .lastIndex when called with a " +
"global RegExp";
print(BUGNUMBER + ": " + summary);
/**************
* BEGIN TEST *
**************/
var s = '0x2x4x6x8';
var p = /x/g;
@ -30,7 +20,3 @@ var arr = s.match(p);
assert.sameValue(arr.length, 4);
arr.forEach(function(v) { assert.sameValue(v, "x"); });
assert.sameValue(p.lastIndex, 0);
/******************************************************************************/
print("Tests complete");

View File

@ -6,13 +6,9 @@ includes: [sm/non262.js, sm/non262-shell.js]
flags:
- noStrict
description: |
pending
Call RegExp.prototype[@@match] from String.prototype.match.
esid: pending
---*/
var BUGNUMBER = 887016;
var summary = "Call RegExp.prototype[@@match] from String.prototype.match.";
print(BUGNUMBER + ": " + summary);
var called = 0;
var myRegExp = {
@ -37,4 +33,3 @@ assert.sameValue("abcAbcABC".match("abc"), 43);
assert.sameValue(called, 1);
RegExp.prototype[Symbol.match] = origMatch;

View File

@ -6,13 +6,9 @@ includes: [sm/non262.js, sm/non262-shell.js]
flags:
- noStrict
description: |
pending
String.prototype.normalize error when normalization form parameter is not an atom
esid: pending
---*/
var BUGNUMBER = 1145326;
var summary = 'String.prototype.normalize error when normalization form parameter is not an atom';
print(BUGNUMBER + ": " + summary);
function test() {
assert.sameValue("abc".normalize("NFKC".split("").join("")), "abc");
@ -24,4 +20,3 @@ if ("normalize" in String.prototype) {
// String.prototype.normalize is not enabled in all builds.
test();
}

View File

@ -6,13 +6,9 @@ includes: [sm/non262.js, sm/non262-shell.js]
flags:
- noStrict
description: |
pending
String.prototype.normalize - normalize no String object
esid: pending
---*/
var BUGNUMBER = 918987;
var summary = 'String.prototype.normalize - normalize no String object';
print(BUGNUMBER + ": " + summary);
function test() {
var myobj = {
@ -26,4 +22,3 @@ if ("normalize" in String.prototype) {
// String.prototype.normalize is not enabled in all builds.
test();
}

View File

@ -6,13 +6,9 @@ includes: [sm/non262.js, sm/non262-shell.js]
flags:
- noStrict
description: |
pending
String.prototype.normalize - passing wrong parameter
esid: pending
---*/
var BUGNUMBER = 918987;
var summary = 'String.prototype.normalize - passing wrong parameter';
print(BUGNUMBER + ": " + summary);
function test() {
assert.throws(RangeError, () => "abc".normalize("NFE"),
@ -25,4 +21,3 @@ if ("normalize" in String.prototype) {
// String.prototype.normalize is not enabled in all builds.
test();
}

View File

@ -6,13 +6,9 @@ includes: [sm/non262.js, sm/non262-shell.js]
flags:
- noStrict
description: |
pending
String.prototype.normalize - normalize rope string
esid: pending
---*/
var BUGNUMBER = 918987;
var summary = 'String.prototype.normalize - normalize rope string';
print(BUGNUMBER + ": " + summary);
function test() {
/* JSRope test */
@ -29,4 +25,3 @@ if ("normalize" in String.prototype) {
// String.prototype.normalize is not enabled in all builds.
test();
}

View File

@ -6,13 +6,9 @@ includes: [sm/non262.js, sm/non262-shell.js]
flags:
- noStrict
description: |
pending
String.raw
esid: pending
---*/
var BUGNUMBER = 1039774;
var summary = 'String.raw';
print(BUGNUMBER + ": " + summary);
assert.throws(TypeError, function() { String.raw(); });
@ -62,4 +58,3 @@ assert.sameValue(String.raw(cooked, "x", "y"), "axb");
cooked.raw = {length: 4, '0':"a", '1':"b", '2':"c"};
assert.sameValue(String.raw(cooked, "x", "y"), "axbycundefined");

View File

@ -6,32 +6,16 @@ includes: [sm/non262.js, sm/non262-shell.js]
flags:
- noStrict
description: |
pending
RegExpStatics::makeMatch should make an undefined value when the last match had an undefined capture.
esid: pending
---*/
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
var BUGNUMBER = 369778;
var summary =
"RegExpStatics::makeMatch should make an undefined value when the last " +
"match had an undefined capture.";
print(BUGNUMBER + ": " + summary);
/**************
* BEGIN TEST *
**************/
var expected = undefined;
var actual;
'x'.replace(/x(.)?/g, function(m, group) { actual = group; })
print("expected: " + expected)
print("actual: " + actual)
assert.sameValue(expected, actual)
/******************************************************************************/

View File

@ -6,13 +6,9 @@ includes: [sm/non262.js, sm/non262-shell.js]
flags:
- noStrict
description: |
pending
String.prototype.replace should call GetMethod.
esid: pending
---*/
var BUGNUMBER = 1290655;
var summary = "String.prototype.replace should call GetMethod.";
print(BUGNUMBER + ": " + summary);
function create(value) {
return {
@ -30,4 +26,3 @@ for (let v of [null, undefined]) {
for (let v of [1, true, Symbol.iterator, "", {}, []]) {
assert.throws(TypeError, () => "a-a".replace(create(v)));
}

View File

@ -8,15 +8,9 @@ includes: [sm/non262.js, sm/non262-shell.js]
flags:
- noStrict
description: |
pending
Be more careful with string math to avoid wrong results
esid: pending
---*/
var BUGNUMBER = 805121;
var summary = "Be more careful with string math to avoid wrong results";
print(BUGNUMBER + ": " + summary);
/******************************************************************************/
function puff(x, n)
{
@ -37,7 +31,3 @@ catch (e)
{
// OOM also acceptable
}
/******************************************************************************/
print("Tests complete");

View File

@ -8,19 +8,9 @@ includes: [sm/non262.js, sm/non262-shell.js]
flags:
- noStrict
description: |
pending
String.prototype.replace should throw when called with a global RegExp whose .lastIndex is non-writable
esid: pending
---*/
var BUGNUMBER = 501739;
var summary =
"String.prototype.replace should throw when called with a global RegExp " +
"whose .lastIndex is non-writable";
print(BUGNUMBER + ": " + summary);
/**************
* BEGIN TEST *
**************/
var s = '0x2x4x6x8';
@ -125,7 +115,3 @@ catch (e)
"should have thrown a TypeError, instead got: " + e);
assert.sameValue(p6.lastIndex, 3);
}
/******************************************************************************/
print("Tests complete");

View File

@ -8,19 +8,9 @@ includes: [sm/non262.js, sm/non262-shell.js]
flags:
- noStrict
description: |
pending
String.prototype.relace should zero the .lastIndex when called with a global RegExp
esid: pending
---*/
var BUGNUMBER = 501739;
var summary =
"String.prototype.relace should zero the .lastIndex when called with a " +
"global RegExp";
print(BUGNUMBER + ": " + summary);
/**************
* BEGIN TEST *
**************/
var s = '0x2x4x6x8';
@ -37,7 +27,3 @@ s.replace(p2, function(s) {
return 'y';
});
assert.sameValue(p2.lastIndex, 4);
/******************************************************************************/
print("Tests complete");

View File

@ -6,13 +6,9 @@ includes: [sm/non262.js, sm/non262-shell.js]
flags:
- noStrict
description: |
pending
Call RegExp.prototype[@@replace] from String.prototype.replace.
esid: pending
---*/
var BUGNUMBER = 887016;
var summary = "Call RegExp.prototype[@@replace] from String.prototype.replace.";
print(BUGNUMBER + ": " + summary);
var called = 0;
var myRegExp = {
@ -25,4 +21,3 @@ var myRegExp = {
};
assert.sameValue("abcAbcABC".replace(myRegExp, "foo"), 42);
assert.sameValue(called, 1);

View File

@ -6,13 +6,9 @@ includes: [sm/non262.js, sm/non262-shell.js]
flags:
- noStrict
description: |
pending
String.prototype.search should call GetMethod.
esid: pending
---*/
var BUGNUMBER = 1290655;
var summary = "String.prototype.search should call GetMethod.";
print(BUGNUMBER + ": " + summary);
function create(value) {
return {
@ -30,4 +26,3 @@ for (let v of [null, undefined]) {
for (let v of [1, true, Symbol.iterator, "", {}, []]) {
assert.throws(TypeError, () => "a-a".search(create(v)));
}

View File

@ -6,13 +6,9 @@ includes: [sm/non262.js, sm/non262-shell.js]
flags:
- noStrict
description: |
pending
Call RegExp.prototype[@@search] from String.prototype.search.
esid: pending
---*/
var BUGNUMBER = 887016;
var summary = "Call RegExp.prototype[@@search] from String.prototype.search.";
print(BUGNUMBER + ": " + summary);
var called = 0;
var myRegExp = {
@ -33,4 +29,3 @@ RegExp.prototype[Symbol.search] = function(S) {
};
assert.sameValue("abcAbcABC".search("abc"), 43);
assert.sameValue(called, 1);

View File

@ -8,17 +8,9 @@ includes: [sm/non262.js, sm/non262-shell.js]
flags:
- noStrict
description: |
pending
String.prototype.split tests
esid: pending
---*/
var BUGNUMBER = 614608;
var summary = "String.prototype.split tests";
print(BUGNUMBER + ": " + summary);
/**************
* BEGIN TEST *
**************/
function assertEqArr(a1, a2) {
assert.sameValue(a1.length, a2.length);
@ -48,5 +40,3 @@ assertEqArr("ab".split(/a*/), ["", "b"]);
assertEqArr("A<B>bold</B>and<CODE>coded</CODE>".split(/<(\/)?([^<>]+)>/),
["A", undefined, "B", "bold", "/", "B", "and", undefined,
"CODE", "coded", "/", "CODE", ""]);
print("All tests passed!");

View File

@ -6,13 +6,9 @@ includes: [sm/non262.js, sm/non262-shell.js, deepEqual.js]
flags:
- noStrict
description: |
pending
String.prototype.split should call GetMethod.
esid: pending
---*/
var BUGNUMBER = 1290655;
var summary = "String.prototype.split should call GetMethod.";
print(BUGNUMBER + ": " + summary);
function create(value) {
return {
@ -30,4 +26,3 @@ for (let v of [null, undefined]) {
for (let v of [1, true, Symbol.iterator, "", {}, []]) {
assert.throws(TypeError, () => "a-a".split(create(v)));
}

View File

@ -6,13 +6,9 @@ includes: [sm/non262.js, sm/non262-shell.js]
flags:
- noStrict
description: |
pending
String.prototype.split should call ToUint32(limit) before ToString(separator).
esid: pending
---*/
var BUGNUMBER = 1287521;
var summary = 'String.prototype.split should call ToUint32(limit) before ToString(separator).';
print(BUGNUMBER + ": " + summary);
var log = [];
"abba".split({
@ -28,4 +24,3 @@ var log = [];
});
assert.sameValue(log.join(","), "limit-valueOf,separator-tostring");

View File

@ -8,17 +8,9 @@ includes: [sm/non262.js, sm/non262-shell.js]
flags:
- noStrict
description: |
pending
String.prototype.split with undefined separator
esid: pending
---*/
var BUGNUMBER = 614608;
var summary = "String.prototype.split with undefined separator";
print(BUGNUMBER + ": " + summary);
/**************
* BEGIN TEST *
**************/
function assertEqArr(a1, a2) {
assert.sameValue(a1.length, a2.length);
@ -38,5 +30,3 @@ assertEqArr(s.split("undefined", 1), ["--"]);
assertEqArr(s.split("-", 0), []);
assertEqArr(s.split(undefined, 0), []);
assertEqArr(s.split(s, 0), []);
print("All tests passed!");

View File

@ -6,7 +6,7 @@ includes: [sm/non262.js, sm/non262-shell.js]
flags:
- noStrict
description: |
pending
String.prototype.split with regexp separator
esid: pending
---*/
/*
@ -34,14 +34,6 @@ esid: pending
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
var BUGNUMBER = 614608;
var summary = "String.prototype.split with regexp separator";
print(BUGNUMBER + ": " + summary);
/**************
* BEGIN TEST *
**************/
var ecmaSampleRe = /<(\/)?([^<>]+)>/;
@ -122,5 +114,3 @@ function testSplit() {
}
testSplit();
print("All tests passed!");

View File

@ -6,13 +6,9 @@ includes: [sm/non262.js, sm/non262-shell.js]
flags:
- noStrict
description: |
pending
Call RegExp.prototype[@@split] from String.prototype.split.
esid: pending
---*/
var BUGNUMBER = 887016;
var summary = "Call RegExp.prototype[@@split] from String.prototype.split.";
print(BUGNUMBER + ": " + summary);
var called = 0;
var myRegExp = {
@ -25,4 +21,3 @@ var myRegExp = {
};
assert.sameValue("abcAbcABC".split(myRegExp, 10).join(","), "X,Y,Z");
assert.sameValue(called, 1);

View File

@ -6,13 +6,9 @@ includes: [sm/non262.js, sm/non262-shell.js]
flags:
- noStrict
description: |
pending
Add \\u{xxxxxx} string literals
esid: pending
---*/
var BUGNUMBER = 320500;
var summary = 'Add \\u{xxxxxx} string literals';
print(BUGNUMBER + ": " + summary);
assert.sameValue("\u{0}", String.fromCodePoint(0x0));
assert.sameValue("\u{1}", String.fromCodePoint(0x1));
@ -70,4 +66,3 @@ assert.throws(SyntaxError, () => eval(`"\\u{FFFF }"`));
assert.throws(SyntaxError, () => eval(`"\\u{FF FF}"`));
assert.throws(SyntaxError, () => eval(`"\\u{F F F F}"`));
assert.throws(SyntaxError, () => eval(`"\\u{100000001}"`));