[gjs/wip/ptomato/tests: 16/26] coverage test: Fix equality error



commit de746696a4c79386f5d6fab3425231fc6a82ff34
Author: Philip Chimento <philip chimento gmail com>
Date:   Wed Oct 26 00:39:05 2016 -0700

    coverage test: Fix equality error
    
    There was an error in the functionDeclarationsEqual() tester which caused
    some tests not to fail that should have failed. I believe these are
    errors in the expected values in the tests, rather than actual errors in
    the code.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=775444

 installed-tests/js/testCoverage.js |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/installed-tests/js/testCoverage.js b/installed-tests/js/testCoverage.js
index 7948074..6b48adb 100644
--- a/installed-tests/js/testCoverage.js
+++ b/installed-tests/js/testCoverage.js
@@ -280,7 +280,7 @@ function parseScriptForFunctionNames(script) {
 }
 
 function functionDeclarationsEqual(actual, expected) {
-    JSUnit.assertEquals(expected.name, actual.name);
+    JSUnit.assertEquals(expected.key, actual.key);
     JSUnit.assertEquals(expected.line, actual.line);
     JSUnit.assertEquals(expected.n_params, actual.n_params);
 }
@@ -375,7 +375,7 @@ function testFunctionsInsideSequence() {
 
     assertArrayEquals(foundFunctions,
                       [
-                          { key: "(anonymous):1:0", line: 1, n_params: 1 },
+                          { key: "(anonymous):1:1", line: 1, n_params: 1 },
                           { key: "(anonymous):1:2", line: 1, n_params: 2 },
                       ],
                       functionDeclarationsEqual);
@@ -589,7 +589,7 @@ function testFunctionsOnEitherSideOfConditionalExpression() {
     assertArrayEquals(foundFunctions,
                       [
                           { key: "(anonymous):2:1", line: 2, n_params: 1 },
-                          { key: "(anonymous):2:1", line: 2, n_params: 2 }
+                          { key: "(anonymous):2:2", line: 2, n_params: 2 }
                       ],
                       functionDeclarationsEqual);
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]