<commit_before># encoding: UTF-8

module ArtDecomp describe QuGenerator::BlockTable do

  context '#blankets' do

    def qus
      fsm   = mock FSM, beta_f: @beta_f, beta_q: @beta_q, beta_x: @beta_x
      archs = Set[Arch[3,1]]
      bt    = QuGenerator::BlockTable.new
      bt.blankets(fsm, Set[0], Set[1]).to_a
    end

    it 'folds Q blocks that match in the first go' do
      @beta_f = Blanket[]
      @beta_q = Blanket[B[1,2], B[2], B[3]]
      @beta_x = Blanket[B[1], B[2], B[3]]
      qus.first.should == Blanket[B[1,2,3], B[2]]
    end

    it 'doesn’t fold Q blocks if they don’t match' do
      @beta_f = Blanket[]
      @beta_q = Blanket[B[1,2], B[2,3]]
      @beta_x = Blanket[B[1], B[2], B[3]]
      qus.first.should == Blanket[B[1,2], B[2,3]]
    end

    it 'first tries to fold matching blocks and then folds by r-admissibility' do
      @beta_f = mock Blanket, :seps => Set[Sep[1,2], Sep[2,3]]
      @beta_q = Blanket[B[1], B[2], B[3]]
      @beta_x = Blanket[B[1,2,3], B[1,3]]
      qus.should == [Blanket[B[1], B[2], B[3]], Blanket[B[1,3], B[2]], Blanket[B[1,2,3]]]
    end

  end
<commit_msg>switch QuGenerator::BlockTable spec to Ruby 1.9 Hash syntax<commit_after># encoding: UTF-8

module ArtDecomp describe QuGenerator::BlockTable do

  context '#blankets' do

    def qus
      fsm   = mock FSM, beta_f: @beta_f, beta_q: @beta_q, beta_x: @beta_x
      archs = Set[Arch[3,1]]
      bt    = QuGenerator::BlockTable.new
      bt.blankets(fsm, Set[0], Set[1]).to_a
    end

    it 'folds Q blocks that match in the first go' do
      @beta_f = Blanket[]
      @beta_q = Blanket[B[1,2], B[2], B[3]]
      @beta_x = Blanket[B[1], B[2], B[3]]
      qus.first.should == Blanket[B[1,2,3], B[2]]
    end

    it 'doesn’t fold Q blocks if they don’t match' do
      @beta_f = Blanket[]
      @beta_q = Blanket[B[1,2], B[2,3]]
      @beta_x = Blanket[B[1], B[2], B[3]]
      qus.first.should == Blanket[B[1,2], B[2,3]]
    end

    it 'first tries to fold matching blocks and then folds by r-admissibility' do
      @beta_f = mock Blanket, seps: Set[Sep[1,2], Sep[2,3]]
      @beta_q = Blanket[B[1], B[2], B[3]]
      @beta_x = Blanket[B[1,2,3], B[1,3]]
      qus.should == [Blanket[B[1], B[2], B[3]], Blanket[B[1,3], B[2]], Blanket[B[1,2,3]]]
    end

  end

{'fraction_non_alphanumeric': 0.17802197802197803, 'fraction_numerical': 0.043076923076923075, 'mean_word_length': 2.965156794425087, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6338444', 'n_tokens_mistral': 1008, 'n_tokens_neox': 960, 'n_words': 233}