dap commit: switched a function string comparison test to use a regex (firefox puts a \n between brackets)

changeset:   166:f168630fdee3
tag:         tip
user:        Marcos Caceres <w3c@marcosc.com>
date:        Tue Jul 17 13:21:20 2012 +0100
files:       light/tests/submissions/marcosc/DeviceLight_tests.js light/tests/submissions/marcosc/index.html proximity/tests/submissions/marcos/DeviceProximityEvent_tests.js proximity/tests/submissions/marcos/UserProximityEvent_tests.js
description:
switched a function string comparison test to use a regex (firefox puts a \n between brackets)


diff -r efb0e4c8ffeb -r f168630fdee3 light/tests/submissions/marcosc/DeviceLight_tests.js
--- a/light/tests/submissions/marcosc/DeviceLight_tests.js	Tue Jul 17 12:42:07 2012 +0100
+++ b/light/tests/submissions/marcosc/DeviceLight_tests.js	Tue Jul 17 13:21:20 2012 +0100
@@ -118,7 +118,7 @@
 
   test(function() {
     var event = new DeviceLightEvent(function test() {});
-    assert_equals(event.type, 'function test() {}');
+    assert_regex_match(event.type, /function test.+{\s?}/);
   }, 'type argument is function');
 
   test(function() {
diff -r efb0e4c8ffeb -r f168630fdee3 light/tests/submissions/marcosc/index.html
--- a/light/tests/submissions/marcosc/index.html	Tue Jul 17 12:42:07 2012 +0100
+++ b/light/tests/submissions/marcosc/index.html	Tue Jul 17 13:21:20 2012 +0100
@@ -1,5 +1,5 @@
 <!doctype html>
-<meta encoding=utf8>
+<meta charset=utf8>
 <meta content="width=device-width, initial-scale=1" name=viewport>
 <meta>
 <title>Light Events Test Suite</title> 
diff -r efb0e4c8ffeb -r f168630fdee3 proximity/tests/submissions/marcos/DeviceProximityEvent_tests.js
--- a/proximity/tests/submissions/marcos/DeviceProximityEvent_tests.js	Tue Jul 17 12:42:07 2012 +0100
+++ b/proximity/tests/submissions/marcos/DeviceProximityEvent_tests.js	Tue Jul 17 13:21:20 2012 +0100
@@ -118,7 +118,7 @@
 
     test(function() {
         var event = new DeviceProximityEvent(function test() {});
-        assert_equals(event.type, 'function test() {}');
+        assert_regex_match(event.type, /function test.+{\s?}/);
     }, 'type argument is function');
 
     test(function() {
diff -r efb0e4c8ffeb -r f168630fdee3 proximity/tests/submissions/marcos/UserProximityEvent_tests.js
--- a/proximity/tests/submissions/marcos/UserProximityEvent_tests.js	Tue Jul 17 12:42:07 2012 +0100
+++ b/proximity/tests/submissions/marcos/UserProximityEvent_tests.js	Tue Jul 17 13:21:20 2012 +0100
@@ -117,7 +117,7 @@
 
     test(function() {
         var event = new UserProximityEvent(function test() {});
-        assert_equals(event.type, 'function test() {}');
+        assert_regex_match(event.type, /function test.+{\s?}/);
     }, 'type argument is function');
 
     test(function() {

Received on Tuesday, 17 July 2012 12:21:35 UTC