forked from mixxxdj/mixxx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlcstest.cpp
36 lines (27 loc) · 867 Bytes
/
lcstest.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
31
32
33
34
35
36
#include <gtest/gtest.h>
#include <QtDebug>
#include "util/lcs.h"
class LCSTest : public testing::Test {
protected:
virtual void SetUp() {
}
virtual void TearDown() {
}
};
TEST_F(LCSTest, BasicLCS) {
ASSERT_STREQ(qPrintable(QString("FOO")),
qPrintable(LCS("FOO", "FOO")));
ASSERT_STREQ(qPrintable(QString("")),
qPrintable(LCS("FOO", "BAR")));
// Prefix
ASSERT_STREQ(qPrintable(QString("FOO")),
qPrintable(LCS("FOO", "FOO BAR")));
// Suffix
ASSERT_STREQ(qPrintable(QString("FOO")),
qPrintable(LCS("FOO", "BAR FOO")));
// Infix
ASSERT_STREQ(qPrintable(QString("FOO")),
qPrintable(LCS("FOO", "BAR FOO BAZ")));
ASSERT_STREQ(qPrintable(QString(" FOO ")),
qPrintable(LCS("QUUX FOO FROB", "BAR FOO BAZ")));
}