22 void SetColumnRange(
int first,
int last) {
28 class ColPartitionTest :
public testing::Test {
31 std::locale::global(std::locale(
""));
37 TEST_F(ColPartitionTest, IsInSameColumnAsReflexive) {
38 TestableColPartition a, b;
39 a.SetColumnRange(1, 2);
40 b.SetColumnRange(3, 3);
42 EXPECT_TRUE(a.IsInSameColumnAs(a));
43 EXPECT_TRUE(b.IsInSameColumnAs(b));
46 TEST_F(ColPartitionTest, IsInSameColumnAsBorders) {
47 TestableColPartition a, b, c, d;
48 a.SetColumnRange(0, 1);
49 b.SetColumnRange(1, 2);
50 c.SetColumnRange(2, 3);
51 d.SetColumnRange(4, 5);
53 EXPECT_TRUE(a.IsInSameColumnAs(b));
54 EXPECT_TRUE(b.IsInSameColumnAs(a));
55 EXPECT_FALSE(c.IsInSameColumnAs(d));
56 EXPECT_FALSE(d.IsInSameColumnAs(c));
57 EXPECT_FALSE(a.IsInSameColumnAs(d));
60 TEST_F(ColPartitionTest, IsInSameColumnAsSuperset) {
61 TestableColPartition a, b;
62 a.SetColumnRange(4, 7);
63 b.SetColumnRange(2, 8);
65 EXPECT_TRUE(a.IsInSameColumnAs(b));
66 EXPECT_TRUE(b.IsInSameColumnAs(a));
69 TEST_F(ColPartitionTest, IsInSameColumnAsPartialOverlap) {
70 TestableColPartition a, b;
71 a.SetColumnRange(3, 8);
72 b.SetColumnRange(6, 10);
74 EXPECT_TRUE(a.IsInSameColumnAs(b));
75 EXPECT_TRUE(b.IsInSameColumnAs(a));