#!/bin/bash

set -e

BRANCH="$(git symbolic-ref --short HEAD)"
[[ "${BRANCH:-}" = wip-* ]] && exit 0

echo '+cargo test'
cargo test --all

if which cargo-fmt >/dev/null 2>&1; then
    echo '+cargo fmt -- --check'
    cargo fmt -- --check
fi
