OLD | NEW |
1 // |expected| should be an object indicating the expected type of node. | 1 // |expected| should be an object indicating the expected type of node. |
2 function assert_node(actual, expected) | 2 function assert_node(actual, expected) |
3 { | 3 { |
4 assert_true(actual instanceof expected.type, | 4 assert_true(actual instanceof expected.type, |
5 'Node type mismatch: actual = ' + actual.nodeType + ', expected
= ' + expected.nodeType); | 5 'Node type mismatch: actual = ' + actual.nodeType + ', expected
= ' + expected.nodeType); |
6 if (typeof(expected.id) !== 'undefined') | 6 if (typeof(expected.id) !== 'undefined') |
7 assert_equals(actual.id, expected.id); | 7 assert_equals(actual.id, expected.id); |
8 if (typeof(expected.nodeValue) !== 'undefined') | 8 if (typeof(expected.nodeValue) !== 'undefined') |
9 assert_equals(actual.nodeValue, expected.nodeValue); | 9 assert_equals(actual.nodeValue, expected.nodeValue); |
10 } | 10 } |
OLD | NEW |