Initial commit
[yaffs-website] / node_modules / node-sass / src / libsass / test / test_specificity.cpp
1 #include "../ast.hpp"
2 #include "../context.hpp"
3 #include "../parser.hpp"
4 #include <string>
5 #include <iostream>
6
7 using namespace Sass;
8
9 Context ctx = Context::Data();
10
11 Selector* selector(std::string src)
12 { return Parser::from_c_str(src.c_str(), ctx, "", Position()).parse_selector_list(); }
13
14 void spec(std::string sel)
15 { std::cout << sel << "\t::\t" << selector(sel + ";")->specificity() << std::endl; }
16
17 int main()
18 {
19   spec("foo bar hux");
20   spec(".foo .bar hux");
21   spec("#foo .bar[hux='mux']");
22   spec("a b c d e f");
23
24   return 0;
25 }