|
1505 | 1505 | parser.addListener("property", function(event){
|
1506 | 1506 | Assert.areEqual("*color", event.property.toString());
|
1507 | 1507 | Assert.areEqual("color", event.property.text);
|
| 1508 | + Assert.areEqual("*", event.property.hack.toString(), "Property should be marked as with star hack"); |
1508 | 1509 | Assert.areEqual("#fff", event.value.toString());
|
1509 | 1510 | Assert.areEqual(5, event.property.col, "Property column should be 5.");
|
1510 | 1511 | Assert.areEqual(2, event.property.line, "Property line should be 2.");
|
|
1516 | 1517 | var result = parser.parse(".foo {\n *color: #fff;\n}");
|
1517 | 1518 | },
|
1518 | 1519 |
|
| 1520 | + "Test rule with underscore hack property": function(){ |
| 1521 | + var parser = new Parser({ strict: true, underscoreHack: true}); |
| 1522 | + parser.addListener("property", function(event){ |
| 1523 | + Assert.areEqual("_color", event.property.toString()); |
| 1524 | + Assert.areEqual("color", event.property.text); |
| 1525 | + Assert.areEqual("_", event.property.hack.toString(), "Property should be marked as with underscore hack"); |
| 1526 | + Assert.areEqual("#fff", event.value.toString()); |
| 1527 | + Assert.areEqual(5, event.property.col, "Property column should be 5."); |
| 1528 | + Assert.areEqual(2, event.property.line, "Property line should be 2."); |
| 1529 | + Assert.areEqual(5, event.col, "Event column should be 5."); |
| 1530 | + Assert.areEqual(2, event.line, "Event line should be 2."); |
| 1531 | + Assert.areEqual(13, event.value.parts[0].col, "First part column should be 13."); |
| 1532 | + Assert.areEqual(2, event.value.parts[0].line, "First part line should be 2."); |
| 1533 | + }); |
| 1534 | + var result = parser.parse(".foo {\n _color: #fff;\n}"); |
| 1535 | + }, |
| 1536 | + |
1519 | 1537 | "Test rule with space after property name": function(){
|
1520 | 1538 | var parser = new Parser({ strict: true});
|
1521 | 1539 | parser.addListener("property", function(event){
|
|
0 commit comments