#!/usr/bin/env bash # # Integration test for villas compare. # # Author: Steffen Vogel # SPDX-FileCopyrightText: 2014-2023 Institute for Automation of Complex Power Systems, RWTH Aachen University # SPDX-License-Identifier: Apache-2.0 DIR=$(mktemp -d) pushd ${DIR} function finish { popd rm -rf ${DIR} } trap finish EXIT cat > input.dat < temp.dat villas compare input.dat temp.dat (( $? == 1 )) || exit 2 ( head -n-1 input.dat; echo "1491095597.545159701(55) -0.587785" ) > temp.dat villas compare input.dat temp.dat (( $? == 2 )) || exit 3 ( head -n-1 input.dat; echo "1491095598.545159701(9) -0.587785" ) > temp.dat villas compare input.dat temp.dat (( $? == 3 )) || exit 4 ( head -n-1 input.dat; echo "1491095597.545159701(9) -0.587785 -0.587785" ) > temp.dat villas compare input.dat temp.dat (( $? == 4 )) || exit 5 ( head -n-1 input.dat; echo "1491095597.545159701(9) -1.587785" ) > temp.dat villas compare input.dat temp.dat (( $? == 5 )) || exit 6 ( cat input.dat; echo "1491095597.545159701(9) -0.587785" ) > temp.dat villas compare input.dat temp.dat (( $? == 1 )) || exit 7