Skip to content

Commit

Permalink
add test for non standard left-/rightmin
Browse files Browse the repository at this point in the history
  • Loading branch information
mnater committed Jul 26, 2018
1 parent ba02eab commit c2bbc9e
Showing 1 changed file with 35 additions and 1 deletion.
36 changes: 35 additions & 1 deletion test/configurations.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ t.test("set options: hyphen", function (t) {
t.end();
});

t.test("set options: left-/rightmin", function (t) {
t.test("set options: left-/rightmin (patterns: 2/2)", function (t) {
t.beforeEach(function setup(done) {
H9Y = require("../hyphenopoly.module");
done();
Expand All @@ -167,6 +167,40 @@ t.test("set options: left-/rightmin", function (t) {
t.end();
});

t.test("set options: left-/rightmin (patterns: 2/3)", function (t) {
t.beforeEach(function setup(done) {
H9Y = require("../hyphenopoly.module");
done();
});

t.afterEach(function tearDown(done) {
H9Y = null;
delete require.cache[H9YKey];
done();
});

t.test("left-/rightmin: 2, 2", async function (t) {
const hyphenator = await H9Y.config({
"hyphen": "•",
"leftmin": 2,
"require": ["pt"],
"rightmin": 2
});
t.equal(hyphenator("relativo"), "re•la•ti•vo");
t.end();
});

t.test("left-/rightmin: def, def", async function (t) {
const hyphenator = await H9Y.config({
"hyphen": "•",
"require": ["pt"]
});
t.equal(hyphenator("relativo"), "re•la•tivo");
t.end();
});
t.end();
});

t.test("set options: minWordLength", function (t) {
t.beforeEach(function setup(done) {
H9Y = require("../hyphenopoly.module");
Expand Down

0 comments on commit c2bbc9e

Please sign in to comment.