From 8b0d96fff91110688bf4c4593550e035e88223c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20H=C3=BCbelbauer?= Date: Wed, 17 Jan 2018 19:17:03 +0100 Subject: [PATCH] Script for checking no of tabs in TEST-DATA.csv so it never breaks GitHub preview (#39) * Check for equal number of tabs on each line of TEST-DATA.tsv * Fix script name * Move to tests --- .travis.yml | 3 +++ tests/check-lines.sh | 11 +++++++++++ 2 files changed, 14 insertions(+) create mode 100644 .travis.yml create mode 100644 tests/check-lines.sh diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..efbddd0 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,3 @@ +before_install: chmod +x tests/check-lines.sh +install: true +script: ./tests/check-lines.sh diff --git a/tests/check-lines.sh b/tests/check-lines.sh new file mode 100644 index 0000000..c35d2d6 --- /dev/null +++ b/tests/check-lines.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash +UNIQUE_TAB_LINES_COUNT=$(sed 's/[^\t]//g' TEST-DATA.tsv | sort -u | wc -l) + +if [ $UNIQUE_TAB_LINES_COUNT -eq "1" ] +then + echo "All lines have the same number of tabs. All good!" +else + echo "Not all lines have the same number of tabs." + echo $UNIQUE_TAB_LINES_COUNT + exit 1 +fi