Skip to content

Commit

Permalink
Added disabled unit test for the future v3.x release
Browse files Browse the repository at this point in the history
  • Loading branch information
kesac committed Jan 7, 2024
1 parent 0ab25a0 commit 1e09c32
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions Syllabore/Syllabore.Tests/SyllableGeneratorTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,40 @@ public void SyllableGenerator_WithNoSequencesDefined_NameGeneratorStillGenerates

}

/* // To be enabled in v3.x
[TestMethod]
public void SyllableGenerator_WithOnlySequencesDefined_SequencesAppearInOutput()
{
// In v2.x, the leading consonant and leading consonant sequence
// pools were separate. This caused an issue when consonant
// sequences were defined, but consonants (non-sequences) were not. The
// sequences never appeared in the output space.
// Another related issue in v2.x was that the default consonant
// probabilities were not 100% and the consonant sequence probability was not
// used unless the consonant probability was non-zero.
var sut = new SyllableGenerator()
.WithLeadingConsonantSequences("th")
.WithTrailingConsonantSequences("ct");
var g = new NameGenerator(sut);
var leadingConsonantSequenceDetected = false;
var trailingConsonantSequenceDetected = false;
for (int i = 0; i < 1000; i++)
{
var name = g.Next().ToLower();
leadingConsonantSequenceDetected |= name.Contains("th");
trailingConsonantSequenceDetected |= name.Contains("ct");
}
Assert.IsTrue(leadingConsonantSequenceDetected && trailingConsonantSequenceDetected);
}
/**/

[TestMethod]
[DataRow(0.0, false, true)]
[DataRow(0.5, true, true)]
Expand Down

0 comments on commit 1e09c32

Please sign in to comment.