]>
Commit | Line | Data |
---|---|---|
342e9ef2 TR |
1 | #!/bin/sh |
2 | ||
3 | test_description='Tests whether perf-lib facilities work' | |
4 | . ./perf-lib.sh | |
5 | ||
6 | test_perf_default_repo | |
7 | ||
8 | test_perf 'test_perf_default_repo works' ' | |
9 | foo=$(git rev-parse HEAD) && | |
10 | test_export foo | |
11 | ' | |
12 | ||
13 | test_checkout_worktree | |
14 | ||
15 | test_perf 'test_checkout_worktree works' ' | |
16 | wt=$(find . | wc -l) && | |
17 | idx=$(git ls-files | wc -l) && | |
18 | test $wt -gt $idx | |
19 | ' | |
20 | ||
21 | baz=baz | |
22 | test_export baz | |
23 | ||
24 | test_expect_success 'test_export works' ' | |
25 | echo "$foo" && | |
26 | test "$foo" = "$(git rev-parse HEAD)" && | |
27 | echo "$baz" && | |
28 | test "$baz" = baz | |
29 | ' | |
30 | ||
31 | test_perf 'export a weird var' ' | |
32 | bar="weird # variable" && | |
33 | test_export bar | |
34 | ' | |
35 | ||
db7ed0f2 ÆAB |
36 | test_perf 'éḿíẗ ńöń-ÁŚĆÍÍ ćḧáŕáćẗéŕś' 'true' |
37 | ||
342e9ef2 TR |
38 | test_expect_success 'test_export works with weird vars' ' |
39 | echo "$bar" && | |
40 | test "$bar" = "weird # variable" | |
41 | ' | |
42 | ||
561ae067 TR |
43 | test_perf 'important variables available in subshells' ' |
44 | test -n "$HOME" && | |
45 | test -n "$TEST_DIRECTORY" && | |
46 | test -n "$TRASH_DIRECTORY" && | |
47 | test -n "$GIT_BUILD_DIR" | |
48 | ' | |
49 | ||
1cbc3240 TR |
50 | test_perf 'test-lib-functions correctly loaded in subshells' ' |
51 | : >a && | |
561ae067 TR |
52 | test_path_is_file a && |
53 | : >b && | |
54 | test_cmp a b | |
1cbc3240 TR |
55 | ' |
56 | ||
342e9ef2 | 57 | test_done |