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

Unified Diff: test/intl/date-format/parse-mdy.js

Issue 18687003: Import intl test suite from v8-i18n project (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: test/intl/date-format/parse-mdy.js
diff --git a/src/extensions/i18n/i18n-extension.h b/test/intl/date-format/parse-mdy.js
similarity index 63%
copy from src/extensions/i18n/i18n-extension.h
copy to test/intl/date-format/parse-mdy.js
index 050c336a67a21fd6cb32892e14215cac11971111..c54190b25cf5ab90a11befd96af20bd6d47bd5f5 100644
--- a/src/extensions/i18n/i18n-extension.h
+++ b/test/intl/date-format/parse-mdy.js
@@ -26,26 +26,25 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// limitations under the License.
-#ifndef V8_EXTENSIONS_I18N_I18N_EXTENSION_H_
-#define V8_EXTENSIONS_I18N_I18N_EXTENSION_H_
+// Testing v8Parse method for date only.
-#include "v8.h"
+var dtf = new Intl.DateTimeFormat(['en']);
-namespace v8_i18n {
+// Make sure we have pattern we expect (may change in the future).
+assertEquals('M/d/y', dtf.resolved.pattern);
-class Extension : public v8::Extension {
- public:
- Extension();
+assertEquals('Sat May 04 1974 00:00:00 GMT-0007 (PDT)',
+ usePDT(String(dtf.v8Parse('5/4/74'))));
+assertEquals('Sat May 04 1974 00:00:00 GMT-0007 (PDT)',
+ usePDT(String(dtf.v8Parse('05/04/74'))));
+assertEquals('Sat May 04 1974 00:00:00 GMT-0007 (PDT)',
+ usePDT(String(dtf.v8Parse('5/04/74'))));
+assertEquals('Sat May 04 1974 00:00:00 GMT-0007 (PDT)',
+ usePDT(String(dtf.v8Parse('5/4/1974'))));
- virtual v8::Handle<v8::FunctionTemplate> GetNativeFunction(
- v8::Handle<v8::String> name);
+// Month is numeric, so it fails on "May".
+assertEquals(undefined, dtf.v8Parse('May 4th 1974'));
- static void Register();
-
- private:
- static Extension* extension_;
-};
-
-} // namespace v8_i18n
-
-#endif // V8_EXTENSIONS_I18N_I18N_EXTENSION_H_
+// Time is ignored from the input, since the pattern doesn't have it.
+assertEquals('Sat May 04 1974 00:00:00 GMT-0007 (PDT)',
+ usePDT(String(dtf.v8Parse('5/4/74 12:30:12'))));

Powered by Google App Engine
This is Rietveld 408576698