Skip to content

Commit

Permalink
测试到出现末尾空格无法正确匹配
Browse files Browse the repository at this point in the history
  • Loading branch information
lindexi committed Feb 8, 2017
1 parent 003ccf5 commit f0c9536
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion EncodingNormalizer.UnitTest/IncludeFileSettingTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.Linq;
using System.Net;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using EncodingNormalior.Model;
using Microsoft.VisualStudio.TestTools.UnitTesting;
Expand All @@ -23,8 +24,26 @@ public void GetaIncludeRegexFile()
}

IncludeFileSetting includeFileSetting = new IncludeFileSetting(new FileInfo(Folder + File));
var includeRegex = includeFileSetting.GetaIncludeRegexFile();
var includeRegex = new List<Regex>();
//全部匹配
foreach (var temp in includeFileSetting.GetaIncludeRegexFile())
{
includeRegex.Add(new Regex(temp));
}

List<string> file = new List<string>()
{
"lindexi.txt",
"1.lindexitxt",
"lindexi.md",
"lindexi.dox",
"lindexi1.txt"
};

foreach (var temp in file)
{
Assert.AreEqual(includeRegex.Any(regex => regex.IsMatch(temp)),true);
}
}

private void WriteFile()
Expand Down

0 comments on commit f0c9536

Please sign in to comment.