Skip to content
This repository
Browse code

Added tests

  • Loading branch information...
commit 7edab1c6deb0b58db7a55ea5f0c30cd9a4d05210 1 parent 8d8500e
Nicholas C. Zakas authored November 28, 2011
4  build/node-parserlib.js
@@ -21,7 +21,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 21
 THE SOFTWARE.
22 22
 
23 23
 */
24  
-/* Version v@VERSION@, Build time: 28-November-2011 12:16:03 */
  24
+/* Version v@VERSION@, Build time: 28-November-2011 12:19:00 */
25 25
 var parserlib = {};
26 26
 (function(){
27 27
 
@@ -931,7 +931,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
931 931
 THE SOFTWARE.
932 932
 
933 933
 */
934  
-/* Version v@VERSION@, Build time: 28-November-2011 12:16:03 */
  934
+/* Version v@VERSION@, Build time: 28-November-2011 12:19:00 */
935 935
 (function(){
936 936
 var EventTarget = parserlib.util.EventTarget,
937 937
 TokenStreamBase = parserlib.util.TokenStreamBase,
2  build/parserlib-core.js
@@ -21,7 +21,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 21
 THE SOFTWARE.
22 22
 
23 23
 */
24  
-/* Version v@VERSION@, Build time: 28-November-2011 12:16:03 */
  24
+/* Version v@VERSION@, Build time: 28-November-2011 12:19:00 */
25 25
 var parserlib = {};
26 26
 (function(){
27 27
 
2  build/parserlib-css.js
@@ -21,7 +21,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 21
 THE SOFTWARE.
22 22
 
23 23
 */
24  
-/* Version v@VERSION@, Build time: 28-November-2011 12:16:03 */
  24
+/* Version v@VERSION@, Build time: 28-November-2011 12:19:00 */
25 25
 (function(){
26 26
 var EventTarget = parserlib.util.EventTarget,
27 27
 TokenStreamBase = parserlib.util.TokenStreamBase,
15  build/parserlib-tests.js
@@ -1466,6 +1466,21 @@
1466 1466
             var result = parser.parse(".foo {\n    color: #fff;\n}");
1467 1467
         },    
1468 1468
     
  1469
+        "Test rule with space after property name": function(){
  1470
+            var parser = new Parser({ strict: true});
  1471
+            parser.addListener("property", function(event){
  1472
+                Assert.areEqual("color", event.property.toString());
  1473
+                Assert.areEqual("#fff", event.value.toString());
  1474
+                Assert.areEqual(5, event.property.col, "Property column should be 5.");
  1475
+                Assert.areEqual(2, event.property.line, "Property line should be 2.");
  1476
+                Assert.areEqual(5, event.col, "Event column should be 5.");
  1477
+                Assert.areEqual(2, event.line, "Event line should be 2.");
  1478
+                Assert.areEqual(13, event.value.parts[0].col, "First part column should be 12.");
  1479
+                Assert.areEqual(2, event.value.parts[0].line, "First part line should be 2.");                
  1480
+            });
  1481
+            var result = parser.parse(".foo {\n    color : #fff;\n}");
  1482
+        },    
  1483
+    
1469 1484
         "Test rule with one property and !important": function(){
1470 1485
             var parser = new Parser({ strict: true});
1471 1486
             parser.addListener("property", function(event){
4  build/parserlib.js
@@ -21,7 +21,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 21
 THE SOFTWARE.
22 22
 
23 23
 */
24  
-/* Version v@VERSION@, Build time: 28-November-2011 12:16:03 */
  24
+/* Version v@VERSION@, Build time: 28-November-2011 12:19:00 */
25 25
 var parserlib = {};
26 26
 (function(){
27 27
 
@@ -931,7 +931,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
931 931
 THE SOFTWARE.
932 932
 
933 933
 */
934  
-/* Version v@VERSION@, Build time: 28-November-2011 12:16:03 */
  934
+/* Version v@VERSION@, Build time: 28-November-2011 12:19:00 */
935 935
 (function(){
936 936
 var EventTarget = parserlib.util.EventTarget,
937 937
 TokenStreamBase = parserlib.util.TokenStreamBase,
15  tests/css/Parser.js
@@ -1466,6 +1466,21 @@
1466 1466
             var result = parser.parse(".foo {\n    color: #fff;\n}");
1467 1467
         },    
1468 1468
     
  1469
+        "Test rule with space after property name": function(){
  1470
+            var parser = new Parser({ strict: true});
  1471
+            parser.addListener("property", function(event){
  1472
+                Assert.areEqual("color", event.property.toString());
  1473
+                Assert.areEqual("#fff", event.value.toString());
  1474
+                Assert.areEqual(5, event.property.col, "Property column should be 5.");
  1475
+                Assert.areEqual(2, event.property.line, "Property line should be 2.");
  1476
+                Assert.areEqual(5, event.col, "Event column should be 5.");
  1477
+                Assert.areEqual(2, event.line, "Event line should be 2.");
  1478
+                Assert.areEqual(13, event.value.parts[0].col, "First part column should be 12.");
  1479
+                Assert.areEqual(2, event.value.parts[0].line, "First part line should be 2.");                
  1480
+            });
  1481
+            var result = parser.parse(".foo {\n    color : #fff;\n}");
  1482
+        },    
  1483
+    
1469 1484
         "Test rule with one property and !important": function(){
1470 1485
             var parser = new Parser({ strict: true});
1471 1486
             parser.addListener("property", function(event){

0 notes on commit 7edab1c

Please sign in to comment.
Something went wrong with that request. Please try again.