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

Side by Side Diff: test/mjsunit/str-to-num.js

Issue 1217007: Fix conform test. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « src/conversions.cc ('k') | 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 2008 the V8 project authors. All rights reserved. 1 // Copyright 2008 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 26 matching lines...) Expand all
37 num >>= 1; 37 num >>= 1;
38 } 38 }
39 39
40 return result; 40 return result;
41 } 41 }
42 42
43 assertEquals('0000000000', repeat('0', 10)); 43 assertEquals('0000000000', repeat('0', 10));
44 44
45 // assertEquals(, toNumber()); 45 // assertEquals(, toNumber());
46 46
47 assertEquals(1, 1.);
48 assertEquals(1, toNumber("1."));
47 49
48 assertEquals(123, toNumber(" 123")); 50 assertEquals(123, toNumber(" 123"));
49 assertEquals(123, toNumber("\n123")); 51 assertEquals(123, toNumber("\n123"));
50 assertEquals(123, toNumber("\r123")); 52 assertEquals(123, toNumber("\r123"));
51 assertEquals(123, toNumber("\t123")); 53 assertEquals(123, toNumber("\t123"));
52 assertEquals(123, toNumber("\f123")); 54 assertEquals(123, toNumber("\f123"));
53 55
54 assertEquals(123, toNumber("123 ")); 56 assertEquals(123, toNumber("123 "));
55 assertEquals(123, toNumber("123\n")); 57 assertEquals(123, toNumber("123\n"));
56 assertEquals(123, toNumber("123\r")); 58 assertEquals(123, toNumber("123\r"));
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 173
172 assertTrue(isNaN(toNumber("junk")), "junk"); 174 assertTrue(isNaN(toNumber("junk")), "junk");
173 assertTrue(isNaN(toNumber("100 junk")), "100 junk"); 175 assertTrue(isNaN(toNumber("100 junk")), "100 junk");
174 assertTrue(isNaN(toNumber("0x100 junk")), "0x100 junk"); 176 assertTrue(isNaN(toNumber("0x100 junk")), "0x100 junk");
175 assertTrue(isNaN(toNumber("100.0 junk")), "100.0 junk"); 177 assertTrue(isNaN(toNumber("100.0 junk")), "100.0 junk");
176 assertTrue(isNaN(toNumber(".1e4 junk")), ".1e4 junk"); 178 assertTrue(isNaN(toNumber(".1e4 junk")), ".1e4 junk");
177 assertTrue(isNaN(toNumber("Infinity junk")), "Infinity junk"); 179 assertTrue(isNaN(toNumber("Infinity junk")), "Infinity junk");
178 assertTrue(isNaN(toNumber("1e")), "1e"); 180 assertTrue(isNaN(toNumber("1e")), "1e");
179 assertTrue(isNaN(toNumber("1e ")), "1e_"); 181 assertTrue(isNaN(toNumber("1e ")), "1e_");
180 assertTrue(isNaN(toNumber("1" + repeat('0', 1000) + 'junk')), "1e1000 junk"); 182 assertTrue(isNaN(toNumber("1" + repeat('0', 1000) + 'junk')), "1e1000 junk");
OLDNEW
« no previous file with comments | « src/conversions.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698