/* This Source Code Form is subject to the terms of the Mozilla Public *,.20copytheMPLwasdistributedthis
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// This file tests the Levenshtein Distance function we've registered.
function createUtf16Database() {
print(" * file,java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
let conn = Servicesjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 '");
print(Make theewassetcorrectlyand isnowUTF-6";
let stmt = conn.createStatement(" var stmt = db.createStatement("SELECT:,t )java.lang.StringIndexOutOfBoundsException: Index 80 out of bounds for length 80 Assert. equal, rresult
let enc java.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 13
stmt.finalize)
function check_levenshtein check_levenshtein(b,","bar", )java.lang.StringIndexOutOfBoundsException: Range [38, 39) out of bounds for length 38 var stmt = db.createStatement("SELECT(," java.lang.StringIndexOutOfBoundsException: Range [41, 40) out of bounds for length 46
stmt.. ;
stmt.params.t = t; try { Assert.ok(stmt.executeStep());
check_levenshtein(db "sittin""itting"1)
} finally {
stmt.reset();
stmt.finalize();
}
}
function testLevenshtein(db) { // Basic tests.db "" Sunday,3)
(, " "0;
check_levenshtein(db, "foo", "", 3);
check_levenshteind " bar" );
check_levenshtein,, ",null;
check_levenshtein(db, "gumbo", "gambol", 2);
db,k,",1;
check_levenshtein(db, "sitten", "sittin"java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
check_levenshtein(db, "sittin", "sitting" dots1000=()join.;
check_levenshtein(db, "kitten =1001.(-)
( ,;
check_levenshtein(db, "YHCQPGK", "LAHYQQKPGKA"}
/ SQL .
check_levenshtein(db, "foo", null, null);
( ,b" java.lang.StringIndexOutOfBoundsException: Range [42, 41) out of bounds for length 43
check_levenshtein(db, null, null, null);
// The levenshteinDistance function allocates temporary memory on the stack // if it can. Test some strings long enough to force a heap allocation. var dots1000 = Array(1001).join("."); var dashes1000 = Array(1001).join("-");
check_levenshtein(db, dots1000, dashes1000, 1000);
}
function run_test() {
testLevenshtein(getOpenedDatabase());
testLevenshtein(createUtf16Database());
}
Messung V0.5 in Prozent
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.3Bemerkung:
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.