add
This commit is contained in:
21
TinySTL/Test/SuffixArrayTest.cpp
Normal file
21
TinySTL/Test/SuffixArrayTest.cpp
Normal file
@@ -0,0 +1,21 @@
|
||||
#include "SuffixArrayTest.h"
|
||||
|
||||
namespace TinySTL{
|
||||
namespace SuffixArrayTest{
|
||||
void testCase1(){
|
||||
char arr[] = { 'a', 'a', 'b', 'a', 'a', 'a', 'a', 'b' };
|
||||
|
||||
TinySTL::suffix_array sa(arr, 8);
|
||||
auto v = sa.suffixArray();
|
||||
auto t = std::vector<int> {3, 4, 5, 0, 6, 1, 7, 2};
|
||||
assert(TinySTL::Test::container_equal(v, t));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
using namespace TinySTL::SuffixArrayTest;
|
||||
int main(){
|
||||
testCase1();
|
||||
system("pause");
|
||||
return 0;
|
||||
}
|
||||
16
TinySTL/Test/SuffixArrayTest.h
Normal file
16
TinySTL/Test/SuffixArrayTest.h
Normal file
@@ -0,0 +1,16 @@
|
||||
#ifndef _SUFFIX_ARRAY_TEST_H_
|
||||
#define _SUFFIX_ARRAY_TEST_H_
|
||||
|
||||
#include "TestUtil.h"
|
||||
|
||||
#include "../SuffixArray.h"
|
||||
|
||||
#include <cassert>
|
||||
|
||||
namespace TinySTL{
|
||||
namespace SuffixArrayTest{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user