Add some get/setString tests.

This commit is contained in:
Heath Nielson 2013-04-26 15:19:23 -06:00
parent d16eb04a8a
commit e98fb410ee
2 changed files with 31 additions and 1 deletions

29
test/strings.js Normal file
View File

@ -0,0 +1,29 @@
(function() {
module("strings");
test("getSubString", function() {
equal(OpenSeadragon.getString("Errors.Dzi"),
"Hmm, this doesn't appear to be a valid Deep Zoom Image.",
"Read sub-string");
});
test("getInvalidString", function() {
equal(OpenSeadragon.getString("Greeting"), "",
"Handled unset string key");
equal(OpenSeadragon.getString("Errors"), "",
"Handled requesting parent key");
});
test("setString", function() {
OpenSeadragon.setString("Greeting", "Hello world");
equal(OpenSeadragon.getString("Greeting"), "Hello world",
"Set a string");
});
test("setSubString", function() {
OpenSeadragon.setString("CustomGreeting.Hello", "Hello world");
equal(OpenSeadragon.getString("CustomGreeting.Hello"), "Hello world",
"Set a sub-string");
});
})();

View File

@ -16,5 +16,6 @@
<script src="/build/openseadragon/openseadragon.min.js"></script>
<script src="/test/util.js"></script>
<script src="/test/basic.js"></script>
<script src="/test/strings.js"></script>
</body>
</html>