예제 #1
0
 /**
  * @param \OttawaDeveloper\Tools\ColorAnalyzer\Color $compareTo
  * 
  * @return boolean
  */
 public function equals(Color $compareTo)
 {
     return $compareTo->red() === $this->red() && $compareTo->green() === $this->green() && $compareTo->blue() === $this->blue() && $compareTo->alpha() === $this->alpha();
 }
예제 #2
0
        $prefix = file_get_contents($dir . 'prefix');
    }
    if (file_exists($dir . 'suffix')) {
        $suffix = file_get_contents($dir . 'suffix');
    }
    foreach (test_files($dir) as $file) {
        $total++;
        list($src, $result) = read_test($file);
        $result = trim($result);
        $eval_out = trim(eval_output($prefix . $src . $suffix));
        if ($eval_out == $result) {
            $correct++;
            echo '.';
        } else {
            add_error($file, $eval_out, $result);
            $fail++;
            echo 'e';
        }
    }
}
print_all_errors();
if ($fail) {
    Color::red();
} else {
    Color::green();
}
puts("Correct: " . $correct);
puts("Fail: " . $fail);
puts("Total: " . $total);
Color::reset();
unlink('tmp.php');