diff --git a/pymacro/macros b/pymacro/macros index 9b87ce8..504fb9b 100644 --- a/pymacro/macros +++ b/pymacro/macros @@ -1,5 +1,5 @@ -.hc hydrocarbon -.h hydrogen -.c carbon +.hc hydrocarbon +.h hydrogen +.c carbon .o oxygen :wink: 😉 diff --git a/pymacro/pymacro b/pymacro/pymacro index 793e34c..70fdb8f 100755 --- a/pymacro/pymacro +++ b/pymacro/pymacro @@ -119,7 +119,7 @@ def get_macros(input): """ # turn input into unvalidated list of macros - macros = [x.split('\t') for x in input.split('\n')] + macros = [re.split('[ \t]', x) for x in input.split('\n')] # validate macros for index, macro in enumerate(macros): diff --git a/pymacro/test.sh b/pymacro/test.sh new file mode 100755 index 0000000..e0f60b4 --- /dev/null +++ b/pymacro/test.sh @@ -0,0 +1,4 @@ +#/usr/bin/env sh +./pymacro -sm tests/test_macros_plural -m tests/test_macros_biology tests/test_input tests/test_actual_output +diff tests/test_actual_output tests/test_expected_output + diff --git a/pymacro/tests/macros b/pymacro/tests/macros deleted file mode 100644 index 9b87ce8..0000000 --- a/pymacro/tests/macros +++ /dev/null @@ -1,5 +0,0 @@ -.hc hydrocarbon -.h hydrogen -.c carbon -.o oxygen -:wink: 😉