Initial commit
[yaffs-website] / node_modules / node-sass / src / libsass / test / test_selector_difference.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 Compound_Selector* selector(std::string src)
12 { return Parser::from_c_str(src.c_str(), ctx, "", Position()).parse_compound_selector(); }
13
14 void diff(std::string s, std::string t)
15 {
16   std::cout << s << " - " << t << " = " << selector(s + ";")->minus(selector(t + ";"), ctx)->to_string() << std::endl;
17 }
18
19 int main()
20 {
21   diff(".a.b.c", ".c.b");
22   diff(".a.b.c", ".fludge.b");
23
24   return 0;
25 }