# frozen_string_literal: true

# Autogenerated code. This code was generated by bin/gen-specs.rb. DO NOT EDIT.
# Edits will be lost once the generator is run again.

RSpec.describe "css-parsing-tests: one_declaration.json" do
  it "parses \"\"" do
    style = ""
    tok = MiniCSS::CSS::Tokenizer.new(style, allow_unicode_ranges: true)
    tok.tokenize
    par = MiniCSS::CSS::Parser.new(tok.tokens)
    sheet = [par.parse_declaration]
    r = MiniCSS::AST.convert(sheet)

    match_ast(r) do
      consume_error("empty")
    end
  end

  it "parses \"  /**/\\n\"" do
    style = "  /**/\n"
    tok = MiniCSS::CSS::Tokenizer.new(style, allow_unicode_ranges: true)
    tok.tokenize
    par = MiniCSS::CSS::Parser.new(tok.tokens)
    sheet = [par.parse_declaration]
    r = MiniCSS::AST.convert(sheet)

    match_ast(r) do
      consume_error("empty")
    end
  end

  it "parses \" ;\"" do
    style = " ;"
    tok = MiniCSS::CSS::Tokenizer.new(style, allow_unicode_ranges: true)
    tok.tokenize
    par = MiniCSS::CSS::Parser.new(tok.tokens)
    sheet = [par.parse_declaration]
    r = MiniCSS::AST.convert(sheet)

    match_ast(r) do
      consume_error("invalid")
    end
  end

  it "parses \"foo\"" do
    style = "foo"
    tok = MiniCSS::CSS::Tokenizer.new(style, allow_unicode_ranges: true)
    tok.tokenize
    par = MiniCSS::CSS::Parser.new(tok.tokens)
    sheet = [par.parse_declaration]
    r = MiniCSS::AST.convert(sheet)

    match_ast(r) do
      consume_error("invalid")
    end
  end

  it "parses \"@foo:\"" do
    style = "@foo:"
    tok = MiniCSS::CSS::Tokenizer.new(style, allow_unicode_ranges: true)
    tok.tokenize
    par = MiniCSS::CSS::Parser.new(tok.tokens)
    sheet = [par.parse_declaration]
    r = MiniCSS::AST.convert(sheet)

    match_ast(r) do
      consume_error("invalid")
    end
  end

  it "parses \"#foo:\"" do
    style = "#foo:"
    tok = MiniCSS::CSS::Tokenizer.new(style, allow_unicode_ranges: true)
    tok.tokenize
    par = MiniCSS::CSS::Parser.new(tok.tokens)
    sheet = [par.parse_declaration]
    r = MiniCSS::AST.convert(sheet)

    match_ast(r) do
      consume_error("invalid")
    end
  end

  it "parses \".foo:\"" do
    style = ".foo:"
    tok = MiniCSS::CSS::Tokenizer.new(style, allow_unicode_ranges: true)
    tok.tokenize
    par = MiniCSS::CSS::Parser.new(tok.tokens)
    sheet = [par.parse_declaration]
    r = MiniCSS::AST.convert(sheet)

    match_ast(r) do
      consume_error("invalid")
    end
  end

  it "parses \"foo*:\"" do
    style = "foo*:"
    tok = MiniCSS::CSS::Tokenizer.new(style, allow_unicode_ranges: true)
    tok.tokenize
    par = MiniCSS::CSS::Parser.new(tok.tokens)
    sheet = [par.parse_declaration]
    r = MiniCSS::AST.convert(sheet)

    match_ast(r) do
      consume_error("invalid")
    end
  end

  it "parses \"foo.. 9000\"" do
    style = "foo.. 9000"
    tok = MiniCSS::CSS::Tokenizer.new(style, allow_unicode_ranges: true)
    tok.tokenize
    par = MiniCSS::CSS::Parser.new(tok.tokens)
    sheet = [par.parse_declaration]
    r = MiniCSS::AST.convert(sheet)

    match_ast(r) do
      consume_error("invalid")
    end
  end

  it "parses \"foo:\"" do
    style = "foo:"
    tok = MiniCSS::CSS::Tokenizer.new(style, allow_unicode_ranges: true)
    tok.tokenize
    par = MiniCSS::CSS::Parser.new(tok.tokens)
    sheet = [par.parse_declaration]
    r = MiniCSS::AST.convert(sheet)

    match_ast(r) do
      decl("foo", important: false) do
        empty!
      end
    end
  end

  it "parses \"foo :\"" do
    style = "foo :"
    tok = MiniCSS::CSS::Tokenizer.new(style, allow_unicode_ranges: true)
    tok.tokenize
    par = MiniCSS::CSS::Parser.new(tok.tokens)
    sheet = [par.parse_declaration]
    r = MiniCSS::AST.convert(sheet)

    match_ast(r) do
      decl("foo", important: false) do
        empty!
      end
    end
  end

  it "parses \"\\n/**/ foo: \"" do
    style = "\n/**/ foo: "
    tok = MiniCSS::CSS::Tokenizer.new(style, allow_unicode_ranges: true)
    tok.tokenize
    par = MiniCSS::CSS::Parser.new(tok.tokens)
    sheet = [par.parse_declaration]
    r = MiniCSS::AST.convert(sheet)

    match_ast(r) do
      decl("foo", important: false) do
        empty!
      end
    end
  end

  it "parses \"foo:;\"" do
    style = "foo:;"
    tok = MiniCSS::CSS::Tokenizer.new(style, allow_unicode_ranges: true)
    tok.tokenize
    par = MiniCSS::CSS::Parser.new(tok.tokens)
    sheet = [par.parse_declaration]
    r = MiniCSS::AST.convert(sheet)

    match_ast(r) do
      decl("foo", important: false) do
        empty!
      end
    end
  end

  it "parses \" /**/ foo /**/ :\"" do
    style = " /**/ foo /**/ :"
    tok = MiniCSS::CSS::Tokenizer.new(style, allow_unicode_ranges: true)
    tok.tokenize
    par = MiniCSS::CSS::Parser.new(tok.tokens)
    sheet = [par.parse_declaration]
    r = MiniCSS::AST.convert(sheet)

    match_ast(r) do
      decl("foo", important: false) do
        empty!
      end
    end
  end

  it "parses \"foo:;bar:;\"" do
    style = "foo:;bar:;"
    tok = MiniCSS::CSS::Tokenizer.new(style, allow_unicode_ranges: true)
    tok.tokenize
    par = MiniCSS::CSS::Parser.new(tok.tokens)
    sheet = [par.parse_declaration]
    r = MiniCSS::AST.convert(sheet)

    match_ast(r) do
      decl("foo", important: false) do
        empty!
      end
    end
  end

  it "parses \"foo: 9000  !Important\"" do
    style = "foo: 9000  !Important"
    tok = MiniCSS::CSS::Tokenizer.new(style, allow_unicode_ranges: true)
    tok.tokenize
    par = MiniCSS::CSS::Parser.new(tok.tokens)
    sheet = [par.parse_declaration]
    r = MiniCSS::AST.convert(sheet)

    match_ast(r) do
      decl("foo", important: true) do
        number 9000, :integer
      end
    end
  end

  it "parses \"foo: 9000  ! /**/\\t IMPORTant /**/\\f\"" do
    style = "foo: 9000  ! /**/\t IMPORTant /**/\f"
    tok = MiniCSS::CSS::Tokenizer.new(style, allow_unicode_ranges: true)
    tok.tokenize
    par = MiniCSS::CSS::Parser.new(tok.tokens)
    sheet = [par.parse_declaration]
    r = MiniCSS::AST.convert(sheet)

    match_ast(r) do
      decl("foo", important: true) do
        number 9000, :integer
      end
    end
  end

  it "parses \"foo: 9000  /* Dotted capital I */!\\u0130mportant\"" do
    style = "foo: 9000  /* Dotted capital I */!\u0130mportant"
    tok = MiniCSS::CSS::Tokenizer.new(style, allow_unicode_ranges: true)
    tok.tokenize
    par = MiniCSS::CSS::Parser.new(tok.tokens)
    sheet = [par.parse_declaration]
    r = MiniCSS::AST.convert(sheet)

    match_ast(r) do
      decl("foo", important: false) do
        number 9000, :integer
        delim " "
        delim "!"
        ident "İmportant"
      end
    end
  end

  it "parses \"foo: 9000  !important!\"" do
    style = "foo: 9000  !important!"
    tok = MiniCSS::CSS::Tokenizer.new(style, allow_unicode_ranges: true)
    tok.tokenize
    par = MiniCSS::CSS::Parser.new(tok.tokens)
    sheet = [par.parse_declaration]
    r = MiniCSS::AST.convert(sheet)

    match_ast(r) do
      decl("foo", important: false) do
        number 9000, :integer
        delim " "
        delim "!"
        ident "important"
        delim "!"
      end
    end
  end

  it "parses \"foo: 9000  important\"" do
    style = "foo: 9000  important"
    tok = MiniCSS::CSS::Tokenizer.new(style, allow_unicode_ranges: true)
    tok.tokenize
    par = MiniCSS::CSS::Parser.new(tok.tokens)
    sheet = [par.parse_declaration]
    r = MiniCSS::AST.convert(sheet)

    match_ast(r) do
      decl("foo", important: false) do
        number 9000, :integer
        delim " "
        ident "important"
      end
    end
  end

  it "parses \"foo:important\"" do
    style = "foo:important"
    tok = MiniCSS::CSS::Tokenizer.new(style, allow_unicode_ranges: true)
    tok.tokenize
    par = MiniCSS::CSS::Parser.new(tok.tokens)
    sheet = [par.parse_declaration]
    r = MiniCSS::AST.convert(sheet)

    match_ast(r) do
      decl("foo", important: false) do
        ident "important"
      end
    end
  end

end