-
Notifications
You must be signed in to change notification settings - Fork 481
/
Copy path0082-test.cpp
30 lines (25 loc) · 853 Bytes
/
0082-test.cpp
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
#include <iostream>
#include <gtest/gtest.h>
#include <string>
#include "../src/0082-Remove-Duplicates-from-Sorted-List-II/0082.cpp"
#include "../util/ListNode.h"
#include "LinkedListUtils.cpp"
TEST(test, test1)
{
LinkedListUtils linkedListUtils;
ListNode *head = linkedListUtils.contructLinkedList({1, 2, 3, 3, 4, 4, 5});
ListNode *expected = linkedListUtils.contructLinkedList({1, 2, 5});
ASSERT_EQ(*expected, *Solution().deleteDuplicates(head));
}
TEST(test, test2)
{
LinkedListUtils linkedListUtils;
ListNode *head = linkedListUtils.contructLinkedList({1, 1, 1, 2, 3});
ListNode *expected = linkedListUtils.contructLinkedList({2, 3});
ASSERT_EQ(*expected, *Solution().deleteDuplicates(head));
}
GTEST_API_ int main(int argc, char **argv)
{
testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}