Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(818)

Side by Side Diff: test/mjsunit/third_party/string-trim.js

Issue 273033: Fixed trim test failure. (Closed)
Patch Set: Created 11 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 Apple Computer, Inc. All rights reserved. 1 // Copyright (c) 2009 Apple Computer, Inc. All rights reserved.
2 // 2 //
3 // Redistribution and use in source and binary forms, with or without 3 // Redistribution and use in source and binary forms, with or without
4 // modification, are permitted provided that the following conditions 4 // modification, are permitted provided that the following conditions
5 // are met: 5 // are met:
6 // 6 //
7 // 1. Redistributions of source code must retain the above copyright 7 // 1. Redistributions of source code must retain the above copyright
8 // notice, this list of conditions and the following disclaimer. 8 // notice, this list of conditions and the following disclaimer.
9 // 9 //
10 // 2. Redistributions in binary form must reproduce the above 10 // 2. Redistributions in binary form must reproduce the above
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 assertEquals(trimString.trimRight(), rightTrimString); 89 assertEquals(trimString.trimRight(), rightTrimString);
90 90
91 assertEquals(leftTrimString.trim(), testString); 91 assertEquals(leftTrimString.trim(), testString);
92 assertEquals(leftTrimString.trimLeft(), leftTrimString); 92 assertEquals(leftTrimString.trimLeft(), leftTrimString);
93 assertEquals(leftTrimString.trimRight(), testString); 93 assertEquals(leftTrimString.trimRight(), testString);
94 94
95 assertEquals(rightTrimString.trim(), testString); 95 assertEquals(rightTrimString.trim(), testString);
96 assertEquals(rightTrimString.trimLeft(), testString); 96 assertEquals(rightTrimString.trimLeft(), testString);
97 assertEquals(rightTrimString.trimRight(), rightTrimString); 97 assertEquals(rightTrimString.trimRight(), rightTrimString);
98 98
99 var testValues = [0, Infinity, NaN, true, false, ({}), ['an','array'] 99 var testValues = [0, Infinity, NaN, true, false, ({}), ['an','array'],
100 ({toString:function(){return 'wibble'}}) 100 ({toString:function(){return 'wibble'}})
101 ]; 101 ];
102 102
103 for (var i = 0; i < testValues.length; i++) { 103 for (var i = 0; i < testValues.length; i++) {
104 assertEquals(trim.call(testValues[i]), String(testValues[i])); 104 assertEquals(trim.call(testValues[i]), String(testValues[i]));
105 assertEquals(trimLeft.call(testValues[i]), String(testValues[i])); 105 assertEquals(trimLeft.call(testValues[i]), String(testValues[i]));
106 assertEquals(trimRight.call(testValues[i]), String(testValues[i])); 106 assertEquals(trimRight.call(testValues[i]), String(testValues[i]));
107 } 107 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698