From 1cf6ff8255491d0e90760364adcacfabbbecca4f Mon Sep 17 00:00:00 2001 From: Laurent Payot Date: Sun, 4 Jun 2023 02:40:42 +0200 Subject: [PATCH] updated tess for new custom hash function --- tests.js | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/tests.js b/tests.js index fa9631c..64798a4 100644 --- a/tests.js +++ b/tests.js @@ -2,7 +2,7 @@ import assert from 'assert/strict' import { randomString } from './benchmark/benchmark.js' -import { minidenticon as minidenticon_CE } from './minidenticons.js' +import { minidenticon as minidenticon_CE } from './minidenticons.min.js' import { minidenticon as minidenticon_NO_CE } from './no-custom-element.min.js' @@ -12,25 +12,25 @@ console.time("\nTests duration") // minidenticon tests -// new Array(minidenticon_CE, minidenticon_NO_CE).forEach(minidenticon => { - -// // non-integer hue normal for empty string -// assert.equal(minidenticon(""), '') -// assert.equal(minidenticon("foo"), '') -// assert.equal(minidenticon("foo", 75), '') -// assert.equal(minidenticon("foo", undefined, 75), '') -// assert.equal(minidenticon("dude42"), '') - -// for (let saturation = 0; saturation < 100; saturation += 5) { -// for (let lightness = 0; lightness < COLLISION_TESTS_NUMBER; lightness += 5) { -// assert.equal( -// minidenticon("foo", saturation, lightness), -// `` -// ) -// } -// } - -// }) +new Array(minidenticon_CE, minidenticon_NO_CE).forEach(minidenticon => { + + // non-integer hue normal for empty string + assert.equal(minidenticon(""), '') + assert.equal(minidenticon("foo"), '') + assert.equal(minidenticon("foo", 75), '') + assert.equal(minidenticon("foo", undefined, 75), '') + assert.equal(minidenticon("laurent"), '') + + for (let saturation = 0; saturation < 100; saturation += 5) { + for (let lightness = 0; lightness < COLLISION_TESTS_NUMBER; lightness += 5) { + assert.equal( + minidenticon("foo", saturation, lightness), + `` + ) + } + } + +}) // collision tests