mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-09 03:48:03 +02:00
test: Make parsing of log files more solid
The old code considered every even "word" as a key and every odd "word" as a value when parsing a test log file. All of the keys end with ':', so restrict with this requirement.
This commit is contained in:
parent
a447e94979
commit
0baf009b39
1 changed files with 3 additions and 1 deletions
|
|
@ -48,6 +48,7 @@ function resetGlobals () {
|
|||
|
||||
|
||||
/* utility functions */
|
||||
function isKey (key) { return key[key.length-1] == ':'; }
|
||||
function normalizeKey (key) { return key.toLowerCase ().replace (/[^a-z0-9]/, ""); }
|
||||
function isVisible (x) { return x.style.display != "none"; }
|
||||
|
||||
|
|
@ -293,7 +294,8 @@ function Test () {
|
|||
|
||||
this.addData = function (array) {
|
||||
for (var i = 0; i < array.length - 1; i += 2)
|
||||
this[normalizeKey (array[i])] = array[i+1];
|
||||
if (isKey (array[i]))
|
||||
this[normalizeKey (array[i])] = array[i+1];
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue