Skip to content

Commit

Permalink
TST: Test some corner-cases for biocore#224
Browse files Browse the repository at this point in the history
extra finicky stuff
  • Loading branch information
fedarko committed Apr 26, 2020
1 parent dd7c849 commit 5d0c3ae
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions qurro/tests/web_tests/tests/test_filter_features.js
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,40 @@ define(["feature_computation", "mocha", "chai", "testing_utilities"], function (
["Feature 1", "Featurelol 2", "Feature 4|lol"]
);
});
it("Doesn't find anything when input only has |s or whitespace", function () {
var queries = [
"|",
" | ",
" |",
"||",
"|||",
"||||",
"| | \t | ",
];
for (var i = 0; i < queries.length; i++) {
chai.assert.empty(
feature_computation.filterFeatures(
rpJSON1,
queries[i],
"Feature ID",
"or"
)
);
}
});
it("Correctly ignores empty | terms", function () {
chai.assert.sameOrderedMembers(
testing_utilities.getFeatureIDsFromObjectArray(
feature_computation.filterFeatures(
rpJSON1,
" || | | |\t | lol |",
"Feature ID",
"or"
)
),
lolMatches
);
});
it("Correctly handles 'polyphyletic taxa' searching problem", function () {
var rpJSONn = JSON.parse(JSON.stringify(rankPlotSkeleton));
// I based the taxonomy information here on what Wikipedia
Expand Down

0 comments on commit 5d0c3ae

Please sign in to comment.