/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// This file tests the unicode functions that we have added
add_task(async function test_upper_ascii() { var stmt = createStatement( "SELECT name, id FROM test WHERE name = upper('a')"
); Assert.ok(stmt.executeStep()); Assert.equal("A", stmt.getString(0)); Assert.equal(2, stmt.getInt32(1));
stmt.reset();
stmt.finalize();
});
add_task(async function test_upper_non_ascii() { var stmt = createStatement( "SELECT name, id FROM test WHERE name = upper(?1)"
);
stmt.bindByIndex(0, LATIN1_ae); Assert.ok(stmt.executeStep()); Assert.equal(LATIN1_AE, stmt.getString(0)); Assert.equal(1, stmt.getInt32(1));
stmt.reset();
stmt.finalize();
});
add_task(async function test_lower_ascii() { var stmt = createStatement( "SELECT name, id FROM test WHERE name = lower('B')"
); Assert.ok(stmt.executeStep()); Assert.equal("b", stmt.getString(0)); Assert.equal(3, stmt.getInt32(1));
stmt.reset();
stmt.finalize();
});
add_task(async function test_lower_non_ascii() { var stmt = createStatement( "SELECT name, id FROM test WHERE name = lower(?1)"
);
stmt.bindByIndex(0, LATIN1_AE); Assert.ok(stmt.executeStep()); Assert.equal(LATIN1_ae, stmt.getString(0)); Assert.equal(4, stmt.getInt32(1));
stmt.reset();
stmt.finalize();
});
add_task(async function test_like_search_different() { var stmt = createStatement("SELECT COUNT(*) FROM test WHERE name LIKE ?1");
stmt.bindByIndex(0, LATIN1_AE); Assert.ok(stmt.executeStep()); Assert.equal(2, stmt.getInt32(0));
stmt.finalize();
});
add_task(async function test_like_search_same() { var stmt = createStatement("SELECT COUNT(*) FROM test WHERE name LIKE ?1");
stmt.bindByIndex(0, LATIN1_ae); Assert.ok(stmt.executeStep()); Assert.equal(2, stmt.getInt32(0));
stmt.finalize();
});
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.13 Sekunden
(vorverarbeitet am 2026-06-04)
¤
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.