test: 更新单元测试
This commit is contained in:
parent
a2778f9b98
commit
87666aa353
|
|
@ -69,22 +69,25 @@ public class SearcherTest
|
||||||
[InlineData(CachePolicy.Content, "v4")]
|
[InlineData(CachePolicy.Content, "v4")]
|
||||||
[InlineData(CachePolicy.VectorIndex, "v4")]
|
[InlineData(CachePolicy.VectorIndex, "v4")]
|
||||||
[InlineData(CachePolicy.File, "v4")]
|
[InlineData(CachePolicy.File, "v4")]
|
||||||
|
[InlineData(CachePolicy.Content, "v6")]
|
||||||
|
[InlineData(CachePolicy.VectorIndex, "v6")]
|
||||||
|
[InlineData(CachePolicy.File, "v6")]
|
||||||
public void TestBenchSearch(CachePolicy cachePolicy, string version)
|
public void TestBenchSearch(CachePolicy cachePolicy, string version)
|
||||||
{
|
{
|
||||||
var _xdbPath = version == "v4" ? _xdbPathV4 : _xdbPathV6;
|
var _xdbPath = version == "v4" ? _xdbPathV4 : _xdbPathV6;
|
||||||
var searcher = new Searcher(cachePolicy, _xdbPath);
|
var searcher = new Searcher(cachePolicy, _xdbPath);
|
||||||
var srcPath = Path.Combine(AppContext.BaseDirectory, "TestData", $"ip{version}_source.txt");
|
var srcPath = Path.Combine(AppContext.BaseDirectory, "TestData", $"ip{version}_source.txt");
|
||||||
|
|
||||||
//foreach (var line in File.ReadLines(srcPath))
|
foreach (var line in File.ReadLines(srcPath))
|
||||||
//{
|
{
|
||||||
// var ps = line.Trim().Split("|", 3);
|
var ps = line.Trim().Split("|", 3);
|
||||||
// var sip = ps[0];
|
var sip = ps[0];
|
||||||
// var eip = ps[1];
|
var eip = ps[1];
|
||||||
|
|
||||||
// var s1 = searcher.Search(sip);
|
var s1 = searcher.Search(sip);
|
||||||
// var s2 = searcher.Search(eip);
|
var s2 = searcher.Search(eip);
|
||||||
// //Assert.Equal(s1, ps[2]);
|
Assert.Equal(s1, ps[2]);
|
||||||
// //Assert.Equal(s2, ps[2]);
|
Assert.Equal(s2, ps[2]);
|
||||||
//}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue