From 4f76c3d8cb0ed979fb9d9245fa600ce1a42f4346 Mon Sep 17 00:00:00 2001 From: Parham Date: Thu, 3 Aug 2023 14:40:05 +0330 Subject: [PATCH] FileConventions.Tests: add failing test Add failing test for WrapText function based on [1]. [1] https://github.com/nblockchain/conventions/issues/117 --- src/FileConventions.Test/WrapTextTests.fs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/FileConventions.Test/WrapTextTests.fs b/src/FileConventions.Test/WrapTextTests.fs index 13d8431e4..bfbd056df 100644 --- a/src/FileConventions.Test/WrapTextTests.fs +++ b/src/FileConventions.Test/WrapTextTests.fs @@ -107,3 +107,24 @@ let WrapTextTest5() = let expectedResult = text Assert.That(WrapText text characterCount, Is.EqualTo expectedResult) + +[] +let WrapTextTest6() = + let characterCount = 64 + let commitMsg = + "foo: this is a header" + + Environment.NewLine + + Environment.NewLine + + "This is a body:" + + Environment.NewLine + + Environment.NewLine + + "```" + + Environment.NewLine + + "A code block that has two conditions, it has a very long line that exceeds the limit." + + Environment.NewLine + + Environment.NewLine + + "It also has multiple paragraphs." + + Environment.NewLine + + "```" + + Assert.That(WrapText commitMsg characterCount, Is.EqualTo commitMsg)