Skip to content

Latest commit

 

History

History
102 lines (70 loc) · 2.14 KB

File metadata and controls

102 lines (70 loc) · 2.14 KB

Running the Phel tests

Prerequisites

Install dependencies:

composer install

Tests live in test/ (configurable in phel-config.php via withTestDirs).

See also the Phel Getting Started guide.

Running the test suite

Full suite:

composer test

A single file:

composer test -- test/clojure/core_test/abs.cljc

A namespace:

composer test -- --filter clojure.core-test.abs

The composer test script sets XDEBUG_MODE=off, which makes startup noticeably faster than calling ./vendor/bin/phel test directly when Xdebug is installed system-wide.

If the runner crashes before printing a report, re-run with --testdox or -v to locate the failing test.

See the Phel testing docs.

Formatting

Format the test sources (uses withFormatDirs from phel-config.php):

./vendor/bin/phel format

Updating the Phel version

composer.json currently pins a stable release:

{
    "require": {
        "phel-lang/phel-lang": "^0.38"
    }
}

Pull the latest matching release:

composer update phel-lang/phel-lang

To track development HEAD instead, switch to dev-main and allow dev stability:

{
    "require": {
        "phel-lang/phel-lang": "dev-main"
    },
    "minimum-stability": "dev",
    "prefer-stable": true
}

Pin to a specific commit (useful for bisecting upstream regressions):

composer require "phel-lang/phel-lang:dev-main#<commit-hash>"

Reader conditionals

The shared .cljc tests select the Phel branch via :phel:

#?(:clj  (Integer/MAX_VALUE)
   :cljs js/Number.MAX_SAFE_INTEGER
   :phel php/PHP_INT_MAX)

Phel exposes PHP globals under the php/ namespace and core types under Phel.Lang.* (e.g. Phel.Lang.ExInfoException, Phel.Lang.Collections.Map.PersistentMapInterface). See writing-tests.md for cross-dialect conventions.