From 2e8e3ffa5df4c538e251b162466327d07713eb6f Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Sat, 24 Sep 2016 06:43:57 -0400 Subject: [PATCH] Add test for Zotero.Utilities.Internal.md5() (Though md5Async() should generally be used instead) --- test/tests/utilities_internalTest.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/tests/utilities_internalTest.js b/test/tests/utilities_internalTest.js index 595270eaf6..29af9e1f50 100644 --- a/test/tests/utilities_internalTest.js +++ b/test/tests/utilities_internalTest.js @@ -1,6 +1,17 @@ "use strict"; describe("Zotero.Utilities.Internal", function () { + describe("#md5()", function () { + it("should generate hex string given file path", function* () { + var file = OS.Path.join(getTestDataDirectory().path, 'test.png'); + assert.equal( + Zotero.Utilities.Internal.md5(Zotero.File.pathToFile(file)), + '93da8f1e5774c599f0942dcecf64b11c' + ); + }) + }) + + describe("#md5Async()", function () { it("should generate hex string given file path", function* () { var file = OS.Path.join(getTestDataDirectory().path, 'test.png');