This commit is contained in:
邹晓航
2014-12-30 11:11:04 +08:00
parent 3971d27bf6
commit c82d80085e
2 changed files with 37 additions and 0 deletions

View 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;
}

View 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