-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge PR #128 from nblockchain/wip/fixBugsReportedInCommitMsg
FileConventions,commitlint: partial fix for [1]. [1] #120
- Loading branch information
Showing
6 changed files
with
151 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
module FileConventions.Test.WrapTextTests | ||
|
||
open System | ||
|
||
open NUnit.Framework | ||
|
||
open FileConventions | ||
|
||
[<Test>] | ||
let WrapTextTest1() = | ||
let characterCount = 64 | ||
|
||
let paragraph = | ||
"This is a very very very very long line with more than 64 characters." | ||
|
||
let expectedResult = | ||
"This is a very very very very long line with more than 64" | ||
+ Environment.NewLine | ||
+ "characters." | ||
|
||
Assert.That(WrapText paragraph characterCount, Is.EqualTo expectedResult) | ||
|
||
[<Test>] | ||
let WrapTextTest2() = | ||
let characterCount = 64 | ||
|
||
let paragraph = | ||
"This is short line." | ||
+ Environment.NewLine | ||
+ "```" | ||
+ Environment.NewLine | ||
+ "This is a very very very very long line with more than 64 characters inside a code block." | ||
+ Environment.NewLine | ||
+ "```" | ||
|
||
let expectedResult = paragraph | ||
|
||
Assert.That(WrapText paragraph characterCount, Is.EqualTo expectedResult) | ||
|
||
[<Test>] | ||
let WrapTextTest3() = | ||
let characterCount = 64 | ||
let tenDigits = "1234567890" | ||
|
||
let seventyChars = | ||
tenDigits | ||
+ tenDigits | ||
+ tenDigits | ||
+ tenDigits | ||
+ tenDigits | ||
+ tenDigits | ||
+ tenDigits | ||
|
||
let paragraph = | ||
"This is short line referring to [1]." | ||
+ Environment.NewLine | ||
+ "[1] someUrl://" | ||
+ seventyChars | ||
|
||
let expectedResult = paragraph | ||
|
||
Assert.That(WrapText paragraph characterCount, Is.EqualTo expectedResult) | ||
|
||
|
||
[<Test>] | ||
let WrapTextTest4() = | ||
let characterCount = 64 | ||
|
||
let text = | ||
"This is short line." | ||
+ Environment.NewLine | ||
+ Environment.NewLine | ||
+ "This is a very very very very very long line with more than 64 characters." | ||
|
||
let expectedResult = | ||
"This is short line." | ||
+ Environment.NewLine | ||
+ Environment.NewLine | ||
+ "This is a very very very very very long line with more than 64" | ||
+ Environment.NewLine | ||
+ "characters." | ||
|
||
Assert.That(WrapText text characterCount, Is.EqualTo expectedResult) | ||
|
||
[<Test>] | ||
let WrapTextTest5() = | ||
let characterCount = 64 | ||
|
||
let text = | ||
"Fixed bug (a title of less than 50 chars)" | ||
+ Environment.NewLine | ||
+ Environment.NewLine | ||
+ "These were the steps to reproduce:" | ||
+ Environment.NewLine | ||
+ "Do foo." | ||
+ Environment.NewLine | ||
+ Environment.NewLine | ||
+ "Current results:" | ||
+ Environment.NewLine | ||
+ "Bar happens." | ||
+ Environment.NewLine | ||
+ Environment.NewLine | ||
+ "Expected results:" | ||
+ Environment.NewLine | ||
+ "Baz happens." | ||
|
||
let expectedResult = text | ||
|
||
Assert.That(WrapText text characterCount, Is.EqualTo expectedResult) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters