mirror of
https://github.com/Green-Sky/crdt_tests.git
synced 2025-12-06 18:36:35 +01:00
bugfixing, debug. still broken, but better
This commit is contained in:
@@ -398,8 +398,21 @@ void testChange1(size_t seed) {
|
||||
assert(doc.getText() == otherdoc.getText());
|
||||
}
|
||||
|
||||
void testBugSame(void) {
|
||||
Doc doc;
|
||||
doc.local_agent = 'A';
|
||||
|
||||
std::string_view new_text1{"a"};
|
||||
doc.merge(new_text1);
|
||||
assert(doc.getText() == new_text1);
|
||||
|
||||
std::string_view new_text2{"aa"};
|
||||
doc.merge(new_text2);
|
||||
assert(doc.getText() == new_text2);
|
||||
}
|
||||
|
||||
int main(void) {
|
||||
const size_t loops = 10'000;
|
||||
const size_t loops = 1'000;
|
||||
{
|
||||
std::cout << "testEmptyDocAdds:\n";
|
||||
for (size_t i = 0; i < loops; i++) {
|
||||
@@ -453,6 +466,13 @@ int main(void) {
|
||||
}
|
||||
}
|
||||
|
||||
std::cout << std::string(40, '=') << "\n";
|
||||
|
||||
{
|
||||
std::cout << "testBugNLNL:\n";
|
||||
testBugSame();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user