#!/bin/sh

set -e

# ocamldep checks whether its stdin is a terminal, so we have to
# write tests that work in case the stdin of ocamldsort is redirected.

cd debian/tests/modules
expected="c.cmo b.cmo a.cmo"
result=$(ocamldep *.ml | ocamldsort -byte *.ml)
if [ "$result" != "$expected" ]
then
    echo ocamldsort returned $result
    exit 1
fi   
