Blame test/test_specificity.cpp

Packit Service 7770af
#include "../ast.hpp"
Packit Service 7770af
#include "../context.hpp"
Packit Service 7770af
#include "../parser.hpp"
Packit Service 7770af
#include <string>
Packit Service 7770af
#include <iostream>
Packit Service 7770af
Packit Service 7770af
using namespace Sass;
Packit Service 7770af
Packit Service 7770af
Context ctx = Context::Data();
Packit Service 7770af
Packit Service 7770af
Selector* selector(std::string src)
Packit Service 7770af
{ return Parser::from_c_str(src.c_str(), ctx, "", Position()).parse_selector_list(); }
Packit Service 7770af
Packit Service 7770af
void spec(std::string sel)
Packit Service 7770af
{ std::cout << sel << "\t::\t" << selector(sel + ";")->specificity() << std::endl; }
Packit Service 7770af
Packit Service 7770af
int main()
Packit Service 7770af
{
Packit Service 7770af
  spec("foo bar hux");
Packit Service 7770af
  spec(".foo .bar hux");
Packit Service 7770af
  spec("#foo .bar[hux='mux']");
Packit Service 7770af
  spec("a b c d e f");
Packit Service 7770af
Packit Service 7770af
  return 0;
Packit Service 7770af
}