1
0
Fork 0
firefox/toolkit/components/autocomplete/tests/unit/test_removeMatchAt.js
Daniel Baumann 5e9a113729
Adding upstream version 140.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-25 09:37:52 +02:00

16 lines
517 B
JavaScript

function run_test() {
let result = Cc["@mozilla.org/autocomplete/simple-result;1"].createInstance(
Ci.nsIAutoCompleteSimpleResult
);
result.appendMatch("a", "");
result.appendMatch("b", "");
result.removeMatchAt(0);
Assert.equal(result.matchCount, 1);
Assert.equal(result.getValueAt(0), "b");
result.appendMatch("c", "");
result.removeMatchAt(1);
Assert.equal(result.matchCount, 1);
Assert.equal(result.getValueAt(0), "b");
result.removeMatchAt(0);
Assert.equal(result.matchCount, 0);
}