tarantula-fl
Advanced tools
Comparing version 0.0.3 to 0.0.4
{ | ||
"$schema": "https://raw.githubusercontent.com/rescript-lang/rescript-compiler/master/docs/docson/build-schema.json", | ||
"name": "tarantula-fl", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"sources": { | ||
@@ -6,0 +6,0 @@ "dir" : "src", |
{ | ||
"name": "tarantula-fl", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"scripts": { | ||
@@ -5,0 +5,0 @@ "build": "bsb -make-world", |
# 👾 Tarantula | ||
![Run Test 🔬](https://github.com/JoranHonig/tarantula/workflows/Run%20Test%20%F0%9F%94%AC/badge.svg) | ||
![Run Test 🔬 ](https://github.com/JoranHonig/tarantula/workflows/Run%20Test%20%F0%9F%94%AC/badge.svg) [![npm](https://img.shields.io/npm/v/tarantula-fl)](https://www.npmjs.com/package/tarantula-fl) | ||
[![](https://img.shields.io/twitter/follow/JoranHonig?style=social)](https://twitter.com/JoranHonig) | ||
Implementation of the tarantula fault localisation algorithm in rescript. | ||
@@ -9,3 +11,3 @@ | ||
```sh | ||
npm install | ||
npm install tarantula-fl | ||
``` | ||
@@ -12,0 +14,0 @@ |
@@ -16,2 +16,2 @@ // Generated by ReScript, PLEASE EDIT WITH CARE | ||
exports.tarantulaScore = tarantulaScore; | ||
/* No side effect */ | ||
/* TestData Not a pure module */ |
// Generated by ReScript, PLEASE EDIT WITH CARE | ||
'use strict'; | ||
var Js_dict = require("bs-platform/lib/js/js_dict.js"); | ||
var Belt_Map = require("bs-platform/lib/js/belt_Map.js"); | ||
var Caml_obj = require("bs-platform/lib/js/caml_obj.js"); | ||
@@ -12,3 +12,3 @@ var TestData = require("./TestData.bs.js"); | ||
var sucesses = statement.tests.map(function (t) { | ||
var match = Js_dict.get(results.testResults, t.fullTitle); | ||
var match = Belt_Map.get(results.testResults, t); | ||
if (match === undefined) { | ||
@@ -31,3 +31,3 @@ return 0; | ||
var failures = statement.tests.map(function (t) { | ||
var match = Js_dict.get(results.testResults, t.fullTitle); | ||
var match = Belt_Map.get(results.testResults, t); | ||
if (match === undefined) { | ||
@@ -49,3 +49,3 @@ return 0; | ||
function totalPassed(results) { | ||
return Js_dict.values(results.testResults).filter(function (test) { | ||
return Belt_Map.valuesToArray(results.testResults).filter(function (test) { | ||
return Caml_obj.caml_equal(test.result, "Success"); | ||
@@ -56,3 +56,3 @@ }).length; | ||
function totalFailed(results) { | ||
return Js_dict.values(results.testResults).filter(function (test) { | ||
return Belt_Map.valuesToArray(results.testResults).filter(function (test) { | ||
return Caml_obj.caml_equal(test.result, "Failure"); | ||
@@ -63,2 +63,3 @@ }).length; | ||
var Test = { | ||
TestCmp: TestData.TestCmp, | ||
ParsingError: TestData.ParsingError, | ||
@@ -155,2 +156,4 @@ unwrap: TestData.unwrap, | ||
var TestCmp = TestData.TestCmp; | ||
var ParsingError = TestData.ParsingError; | ||
@@ -165,2 +168,3 @@ | ||
exports.Test = Test; | ||
exports.TestCmp = TestCmp; | ||
exports.ParsingError = ParsingError; | ||
@@ -175,2 +179,2 @@ exports.unwrap = unwrap; | ||
exports.rankSuspects = rankSuspects; | ||
/* No side effect */ | ||
/* TestData Not a pure module */ |
@@ -6,9 +6,42 @@ // Generated by ReScript, PLEASE EDIT WITH CARE | ||
var Js_exn = require("bs-platform/lib/js/js_exn.js"); | ||
var Belt_Id = require("bs-platform/lib/js/belt_Id.js"); | ||
var Js_dict = require("bs-platform/lib/js/js_dict.js"); | ||
var Belt_Int = require("bs-platform/lib/js/belt_Int.js"); | ||
var Belt_Map = require("bs-platform/lib/js/belt_Map.js"); | ||
var Belt_Array = require("bs-platform/lib/js/belt_Array.js"); | ||
var Caml_option = require("bs-platform/lib/js/caml_option.js"); | ||
var Caml_primitive = require("bs-platform/lib/js/caml_primitive.js"); | ||
var Caml_exceptions = require("bs-platform/lib/js/caml_exceptions.js"); | ||
var Caml_js_exceptions = require("bs-platform/lib/js/caml_js_exceptions.js"); | ||
function matchFromEnd(a, b) { | ||
if (a !== undefined) { | ||
if (b !== undefined) { | ||
if (b.endsWith(a)) { | ||
return true; | ||
} else { | ||
return a.endsWith(b); | ||
} | ||
} else { | ||
return false; | ||
} | ||
} else { | ||
return b === undefined; | ||
} | ||
} | ||
function cmp(a, b) { | ||
var match = Caml_primitive.caml_string_compare(a.title, b.title); | ||
var match$1 = matchFromEnd(a.file, b.file); | ||
if (match !== 0 || !match$1) { | ||
return 1; | ||
} else { | ||
return 0; | ||
} | ||
} | ||
var TestCmp = Belt_Id.MakeComparable({ | ||
cmp: cmp | ||
}); | ||
var ParsingError = Caml_exceptions.create("TestData.ParsingError"); | ||
@@ -32,3 +65,3 @@ | ||
title: unwrap(Js_dict.get(testCase, "title"), "Can't find title in test object"), | ||
fullTitle: unwrap(Js_dict.get(testCase, "fullTitle"), "Can't find fullTitle in test object"), | ||
fullTitle: Js_dict.get(testCase, "fullTitle"), | ||
file: Js_dict.get(testCase, "file") | ||
@@ -46,3 +79,3 @@ }, | ||
})); | ||
return Caml_option.some(Js_dict.fromArray(Belt_Array.map($$Array.concat({ | ||
return Caml_option.some(Belt_Map.fromArray(Belt_Array.map($$Array.concat({ | ||
hd: passed, | ||
@@ -55,6 +88,6 @@ tl: { | ||
return [ | ||
testResult.test.fullTitle, | ||
testResult.test, | ||
testResult | ||
]; | ||
})))); | ||
})), TestCmp)); | ||
} | ||
@@ -78,3 +111,3 @@ catch (raw_message){ | ||
title: unwrap(Js_dict.get(solCoverIdentifier, "title"), "Can't find title in test object"), | ||
fullTitle: unwrap(Js_dict.get(solCoverIdentifier, "fullTitle"), "Can't find fullTitle in test object"), | ||
fullTitle: Js_dict.get(solCoverIdentifier, "fullTitle"), | ||
file: Js_dict.get(solCoverIdentifier, "file") | ||
@@ -103,2 +136,3 @@ }; | ||
exports.TestCmp = TestCmp; | ||
exports.ParsingError = ParsingError; | ||
@@ -108,2 +142,2 @@ exports.unwrap = unwrap; | ||
exports.fromSolCover = fromSolCover; | ||
/* No side effect */ | ||
/* TestCmp Not a pure module */ |
@@ -189,3 +189,3 @@ var assert = require('assert') | ||
} | ||
// console.log(testData) | ||
// console.log(testData.toArray()) | ||
@@ -192,0 +192,0 @@ // Act |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
26393
505
35