-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.cpp
More file actions
69 lines (57 loc) · 1.26 KB
/
main.cpp
File metadata and controls
69 lines (57 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#include <iostream>
#include "EditorCore.h"
#include <cassert>
#define TEST_LOG std::cout << core.getContent() <<"\n***************\n";
void superTest(){
std::string input = "wefwefwef\nwefwefwfoirjbrbr\nwefw12wefnbbr\nwefefefrbrb\nbrbrbrowenfef\n";
EditorCore core;
core.appendText(input);
TEST_LOG
core.removeText(2,3,2,5);
TEST_LOG
core.undo();
TEST_LOG
core.insertText(0, 7,"xyxyxyxyxy");
TEST_LOG
core.appendText("APPEND!");
core.appendText("APPEND!");
TEST_LOG
for(int i=0; i< 100;++i){
core.undo();
core.redo();
core.undo();
core.undo();
core.redo();
core.redo();
}
TEST_LOG
core.removeText(0,3,4,8);
TEST_LOG
core.appendText("abcde");
uint32_t len = core.getLineCount();
uint32_t length = core.getLineLength(len-2);
TEST_LOG
core.removeText(len-2, length-1, len-1, 0);
TEST_LOG
///big data pressure test/////
std::cout << "*******big data test********\n";
for(int i = 0; i < 1000; ++i){
core.appendText("this is your test"+std::to_string(i)+"\n");
if(i==0 || i==1){
TEST_LOG
}
}
TEST_LOG
for(int i=0; i< 1000;++i){
core.undo();
}
TEST_LOG
for(int i=0; i< 1000;++i){
core.redo();
}
TEST_LOG
}
int main(int argc, char** argv){
superTest();
return 0;
}