From 0dbf2810a0ee78658c35e61dc447c5f968226cb9 Mon Sep 17 00:00:00 2001 From: Clint Byrum Date: Wed, 18 Sep 2013 18:08:08 -0700 Subject: Add functional tests and examples for merge merge.py is undocumented and untested, which is undesirable, as it does not seem to be going away any time soon. Change-Id: I7e4870e58a32c567e5947b9a48893b8210ad4d65 --- test_merge.bash | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 test_merge.bash (limited to 'test_merge.bash') diff --git a/test_merge.bash b/test_merge.bash new file mode 100644 index 00000000..35390aaa --- /dev/null +++ b/test_merge.bash @@ -0,0 +1,24 @@ +#!/bin/bash +set -ue +result="" +cleanup() { + if [ -n "$result" ] ; then + rm -f $result + fi +} +trap cleanup EXIT +result=$(mktemp /tmp/test_merge.XXXXXX) +fail=0 +python merge.py examples/source.yaml > $result +if ! cmp $result examples/source_lib_result.yaml ; then + diff -u $result examples/source_lib_result.yaml + echo + echo FAIL - merge of source.yaml result does not match expected output + echo + fail=1 +else + echo + echo PASS - merge of source.yaml result matches expected output + echo +fi +exit $fail -- cgit 1.2.3-korg