<commit_before>#!/usr/bin/env ruby
# -*- coding: utf-8 -*-

require "rspec"


options = []
directory = File.expand_path File.dirname __FILE__
if File.exists? "cabal-dev"
  options << "-package-db=#{Dir.glob("cabal-dev/packages-*.conf").first}"
end
if File.exists? ".cabal-sandbox"
  options << "-package-db=#{Dir.glob(".cabal-sandbox/*-packages.conf.d").first}"
end

describe "typecheck:" do
  Dir.glob("#{directory}/should_compile/*").each do |test|
    it "should succeed to compile #{test}" do
      system("ghc -fno-code #{options.join(" ")} #{test} 1>/dev/null 2>&1").should be_true
    end
  end

  failures = "/home/maksenov/git/biegunka-core/tests/typecheck/should_fail"
  Dir.glob("#{directory}/should_fail/*").each do |test|
    it "should fail to compile #{test}" do
      system("ghc -fno-code #{options.join(" ")} #{test} 1>/dev/null 2>&1").should be_false
    end
  end
end
<commit_msg>Different sandboxes are mutually exclusive.<commit_after>#!/usr/bin/env ruby
# -*- coding: utf-8 -*-

require "rspec"


options = []
directory = File.expand_path File.dirname __FILE__
if File.exists? "cabal-dev"
  options << "-package-db=#{Dir.glob("cabal-dev/packages-*.conf").first}"
elsif File.exists? ".cabal-sandbox"
  options << "-package-db=#{Dir.glob(".cabal-sandbox/*-packages.conf.d").first}"
end

describe "typecheck:" do
  Dir.glob("#{directory}/should_compile/*").each do |test|
    it "should succeed to compile #{test}" do
      system("ghc -fno-code #{options.join(" ")} #{test} 1>/dev/null 2>&1").should be_true
    end
  end

  failures = "/home/maksenov/git/biegunka-core/tests/typecheck/should_fail"
  Dir.glob("#{directory}/should_fail/*").each do |test|
    it "should fail to compile #{test}" do
      system("ghc -fno-code #{options.join(" ")} #{test} 1>/dev/null 2>&1").should be_false
    end
  end
end

{'fraction_non_alphanumeric': 0.1951886276653909, 'fraction_numerical': 0.007654455986878075, 'mean_word_length': 3.854111405835544, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '6938148', 'n_tokens_mistral': 673, 'n_tokens_neox': 648, 'n_words': 137}