Skip to content

Commit

Permalink
cleanup test names
Browse files Browse the repository at this point in the history
  • Loading branch information
dhowe committed Nov 4, 2020
1 parent 573f919 commit ee1f902
Show file tree
Hide file tree
Showing 8 changed files with 94 additions and 94 deletions.
14 changes: 7 additions & 7 deletions test/analyzer-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ describe('RiTa.Analyzer', () => {

if (typeof module !== 'undefined') require('./before');

it('Should correctly call analyze.lts', () => {
it('Should call analyze.lts', () => {
let feats;
feats = RiTa.analyze("cloze", { silent: 1 });
expect(feats.pos).eq("nn");
Expand All @@ -14,12 +14,12 @@ describe('RiTa.Analyzer', () => {
//RiTa.SILENCE_LTS = silent;
});

it('Should correctly call syllables.lts', () => {
it('Should call syllables.lts', () => {
let result = RiTa.syllables('The Laggin', {silent:1});
expect(result).eq('dh-ah l-ae/g-ih-n', 'got \'' + result + "'");
});

it('Should correctly call analyze', () => {
it('Should call analyze', () => {

expect(RiTa.analyze('')).eql({ tokens: '', pos: '', stresses: '', phones: '', syllables: '' });

Expand All @@ -39,7 +39,7 @@ describe('RiTa.Analyzer', () => {
expect(feats.syllables).eq(hasLex ? "sh-eh-v/r-ow/l-ey" : 'ch-eh-v/r-ow/l-ah-t');
});

it('Should correctly call stresses', () => {
it('Should call stresses', () => {

let result, answer, word;

Expand Down Expand Up @@ -73,7 +73,7 @@ describe('RiTa.Analyzer', () => {

});

it('Should correctly call phones', () => {
it('Should call phones', () => {

let silent = RiTa.SILENCE_LTS;
RiTa.SILENCE_LTS = true;
Expand Down Expand Up @@ -115,7 +115,7 @@ describe('RiTa.Analyzer', () => {
RiTa.SILENCE_LTS = silent;
});

it('Should correctly call syllables', () => {
it('Should call syllables', () => {

let input, expected;

Expand Down Expand Up @@ -146,7 +146,7 @@ describe('RiTa.Analyzer', () => {
expect(RiTa.syllables(input)).eq(expected);
});

it('Should correctly handle number (singular/plural)', () => {
it('Should handle number (singular/plural)', () => {

let testPairs = [
"dazes", "daze",
Expand Down
8 changes: 4 additions & 4 deletions test/conjugator-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ describe('RiTa.Conjugator', () => {

if (typeof module !== 'undefined') require('./before');

it('Should correctly call pastParticiple', () => {
it('Should call pastParticiple', () => {

equal(RiTa.pastParticiple("sleep"), "slept");
equal(RiTa.pastParticiple("withhold"), "withheld");
Expand Down Expand Up @@ -36,7 +36,7 @@ describe('RiTa.Conjugator', () => {
equal(RiTa.pastParticiple("study"), "studied");
});

it('Should correctly call presentParticiple', () => {
it('Should call presentParticiple', () => {

equal(RiTa.presentParticiple(""), "");
equal(RiTa.presentParticiple("sleep"), "sleeping");
Expand Down Expand Up @@ -65,7 +65,7 @@ describe('RiTa.Conjugator', () => {
equal(RiTa.presentParticiple(" study"), "studying"); // trim
});

it('Should correctly conjugate a vbd', () => {
it('Should conjugate VBDs', () => {
expect(RiTa.conjugate("go", {
number: RiTa.SINGULAR,
person: RiTa.FIRST_PERSON,
Expand All @@ -78,7 +78,7 @@ describe('RiTa.Conjugator', () => {
})).eq("ran");
});

it('Should correctly call conjugate', () => {
it('Should call conjugate', () => {
let args, s, a;

equal("swum", RiTa.pastParticiple("swim"));
Expand Down
28 changes: 14 additions & 14 deletions test/grammar-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ describe('RiTa.Grammar', () => {

let grammars = [sentences1, sentences2, sentences3];

it('should correctly call constructor', () => {
it('should call constructor', () => {
ok(typeof new Grammar() !== 'undefined');
});

Expand Down Expand Up @@ -96,7 +96,7 @@ describe('RiTa.Grammar', () => {
expect(rs).to.be.oneOf(["Dave", "Jill", "Pete"]);
});

it('should correctly resolve inlines', () => { // KNOWN-ISSUES
it('should resolve inlines', () => { // KNOWN-ISSUES
let rg, rs;

rg = new Grammar({
Expand All @@ -120,7 +120,7 @@ describe('RiTa.Grammar', () => {

});

it("should correctly call addRules", () => {
it("should call addRules", () => {

let rg = new Grammar();
ok(typeof rg.rules !== 'undefined');
Expand All @@ -144,15 +144,15 @@ describe('RiTa.Grammar', () => {
});
});

it("should correctly call addRule", () => {
it("should call addRule", () => {
let rg = new Grammar();
rg.addRule("$start", "$pet");
ok(typeof rg.rules["start"] !== 'undefined');
rg.addRule("$start", "$dog", .3);
ok(typeof rg.rules["start"] !== 'undefined');
});

it("should correctly call removeRule", () => {
it("should call removeRule", () => {

grammars.forEach(g => {
let rg1 = new Grammar(g);
Expand Down Expand Up @@ -180,7 +180,7 @@ describe('RiTa.Grammar', () => {
expect(() => rg.expand('bad')).to.throw();
});

it("should correctly call expandFrom", () => {
it("should call expandFrom", () => {
let rg = new Grammar();
rg.addRule("$start", "$pet");
rg.addRule("$pet", "($bird | $mammal)");
Expand All @@ -193,7 +193,7 @@ describe('RiTa.Grammar', () => {
}
});

it("should correctly call toString", () => {
it("should call toString", () => {
let rg = new Grammar({ "$start": "pet" });
eq(rg.toString(), '{\n "start": "pet"\n}');
rg = new Grammar({ "$start": "$pet", "$pet": "dog" });
Expand All @@ -204,7 +204,7 @@ describe('RiTa.Grammar', () => {
eq(rg.toString(), '{\n "start": "$pet.articlize()",\n "pet": "(dog | cat)"\n}');
});

it("should correctly call toString with arg", () => {
it("should call toString with arg", () => {
let lb = '<br/>';
let rg = new Grammar({ "$start": "pet" });
eq(rg.toString(lb), '{<br/> "start": "pet"<br/>}');
Expand All @@ -216,7 +216,7 @@ describe('RiTa.Grammar', () => {
eq(rg.toString(lb), '{<br/> "start": "$pet.articlize()",<br/> "pet": "(dog | cat)"<br/>}');
});

it("should correctly call expand", () => {
it("should call expand", () => {
let rg = new Grammar();
rg.addRule("$start", "pet");
eq(rg.expand(), "pet");
Expand All @@ -226,7 +226,7 @@ describe('RiTa.Grammar', () => {
eq(rg.expand(), "dog");
});

it("should correctly call expand.weights", () => {
it("should call expand.weights", () => {
let rg = new Grammar();
rg.addRule("$start", "$rule1");
rg.addRule("$rule1", "cat | dog | boy");
Expand All @@ -243,7 +243,7 @@ describe('RiTa.Grammar', () => {
ok(found1 && found2 && found3); // found all
});

it("should correctly call expandFrom.weights", () => {
it("should call expandFrom.weights", () => {

let rg = new Grammar();
rg.addRule("$start", "$pet");
Expand All @@ -263,7 +263,7 @@ describe('RiTa.Grammar', () => {
ok(hawks > dogs * 2), 'got h=' + hawks + ', ' + dogs;
});

it("should correctly handle transforms", () => {
it("should handle transforms", () => {
let rg = new Grammar();
rg.addRule("$start", "$pet.toUpperCase()");
rg.addRule("$pet", "dog");
Expand Down Expand Up @@ -326,7 +326,7 @@ describe('RiTa.Grammar', () => {
eq(rg.expand({ trace: 0 }), "mice");
});

it("should correctly handle special characters", () => {
it("should handle special characters", () => {
let rg, res, s;

s = "{ \"$start\": \"hello &#124; name\" }";
Expand Down Expand Up @@ -368,7 +368,7 @@ describe('RiTa.Grammar', () => {
}
});

it("should correctly call toJSON and fromJSON",() => {
it("should call toJSON and fromJSON",() => {
let json = {"$start":"$pet $iphone","$pet":"(dog | cat)","$iphone":"(iphoneSE | iphone12)"};
let rg = new Grammar(json);
let generatedJSON = rg.toJSON();
Expand Down
Loading

0 comments on commit ee1f902

Please sign in to comment.