blob: a4ccf4d6a10f20dd88b0b75681b46978fd891631 (
plain)
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
|
// Unit Tests for Scintilla internal data structures
#include <string.h>
#include "WordList.h"
#include "catch.hpp"
// Test WordList.
TEST_CASE("WordList") {
WordList wl;
SECTION("IsEmptyInitially") {
REQUIRE(0 == wl.Length());
REQUIRE(!wl.InList("struct"));
}
SECTION("InList") {
wl.Set("else struct");
REQUIRE(2 == wl.Length());
REQUIRE(wl.InList("struct"));
REQUIRE(!wl.InList("class"));
}
SECTION("WordAt") {
wl.Set("else struct");
REQUIRE(0 == strcmp(wl.WordAt(0), "else"));
}
}
|