diff --git a/test/strings.js b/test/strings.js new file mode 100644 index 00000000..61a12d93 --- /dev/null +++ b/test/strings.js @@ -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"); + }); + +})(); diff --git a/test/test.html b/test/test.html index 37a9afe4..6ca53fa2 100644 --- a/test/test.html +++ b/test/test.html @@ -16,5 +16,6 @@ + - \ No newline at end of file +