-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest.sh
executable file
·27 lines (19 loc) · 1.11 KB
/
test.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/sh
[ "$(node index.js 'div')" = '<div></div>' ] && echo -n 'ok' || echo -n 'ko'
echo ' div with arg'
[ "$(node index.js 'img')" = '<img src="" alt="">' ] && echo -n 'ok' || echo -n 'ko'
echo ' img with arg'
[ "$(node index.js -x 'img')" = '<img src="" alt="" />' ] && echo -n 'ok' || echo -n 'ko'
echo ' img xhtml with arg'
[ "$(node index.js -p 'div')" = '<div>${1}</div>' ] && echo -n 'ok' || echo -n 'ko'
echo ' div with arg with placeholders'
[ "$(node index.js -p 'img')" = '<img src="${1}" alt="${2}">' ] && echo -n 'ok' || echo -n 'ko'
echo ' img with arg with placeholders'
[ "$(node index.js -p -x 'img')" = '<img src="${1}" alt="${2}" />' ] && echo -n 'ok' || echo -n 'ko'
echo ' img xhtml with arg with placeholders'
[ "$(echo 'div' | node index.js)" = '<div></div>' ] && echo -n 'ok' || echo -n 'ko'
echo ' div from stdin'
[ "$(echo 'div' | node index.js -p)" = '<div>${1}</div>' ] && echo -n 'ok' || echo -n 'ko'
echo ' div from stdin with placeholders'
[ "$(echo 'img' | node index.js -p -x)" = '<img src="${1}" alt="${2}" />' ] && echo -n 'ok' || echo -n 'ko'
echo ' img xhmtl from stdin with placeholders'