예제 #1
0
void test_cases(void)
{
   test_square();
   test_f();
   test_g();
   test_hypotenuse();
   test_is_positive();
}
예제 #2
0
TEST(CSSTest, Selector_Specificity)
{

	CSSSelector selector_a("p");
	CSSSpecificity test_a(0, 0, 0, 1);

	ASSERT_TRUE(selector_a.specificity == test_a);

	CSSSelector selector_b("h1, h2, h3");
	CSSSpecificity test_b(0, 0, 0, 3);

	ASSERT_TRUE(selector_b.specificity == test_b);

	/*
	CSSSelector test_c("p span");

	ASSERT_EQ(1, test_c.count());
	*/

	CSSSelector selector_d("p.section");
	CSSSpecificity test_d(0, 0, 1, 1);

	ASSERT_TRUE(selector_d.specificity == test_d);

	CSSSelector selector_e(".bold");
	CSSSpecificity test_e(0, 0, 1, 0);

	ASSERT_TRUE(selector_e.specificity == test_e);

	CSSSelector selector_f("#id");
	CSSSpecificity test_f(0, 1, 0, 0);

	ASSERT_TRUE(selector_f.specificity == test_f);

	CSSSelector selector_g("span#id");
	CSSSpecificity test_g(0, 1, 0, 1);

	ASSERT_TRUE(selector_g.specificity == test_g);

	CSSSelector selector_h("span#id, p.hello, br");
	CSSSpecificity test_h(0, 1, 1, 3);

	ASSERT_TRUE(selector_h.specificity == test_h);

}
예제 #3
0
TEST(CSSTest, Selector_Matches)
{

	CSSSelector test_a("p");

	ASSERT_TRUE(test_a.matches("p"));

	CSSSelector test_b("h1, h2, h3");

	ASSERT_TRUE(test_b.matches("h1"));
	ASSERT_TRUE(test_b.matches("h2"));
	ASSERT_TRUE(test_b.matches("h3"));

	/*
	CSSSelector test_c("p span");

	ASSERT_EQ(1, test_c.count());
	*/

	CSSSelector test_d("p.section");

	ASSERT_TRUE(test_d.matches("p.section"));

	CSSSelector test_e(".bold");

	ASSERT_TRUE(test_e.matches(".bold"));

	CSSSelector test_f("#id");

	ASSERT_TRUE(test_f.matches("#id"));

	CSSSelector test_g("span#id");

	ASSERT_TRUE(test_g.matches("span#id"));


}