]> ruderich.org/simon Gitweb - config/dotfiles.git/blob - tests/source_config.test
shell/env: Move shell functions to shell/functions.
[config/dotfiles.git] / tests / source_config.test
1 # Test file for source_config().
2
3
4 # Load source_config().
5 . ../shell/env
6
7
8 # Make sure the old temporary directory is removed.
9 rm -rf tmp
10 # Create the test directories/files.
11 mkdir tmp
12 mkdir tmp/bash
13 mkdir tmp/shell
14 mkdir tmp/zsh tmp/zsh/host tmp/zsh/os
15 echo echo loaded bash/env.zucker > tmp/shell/env.zucker
16 echo echo loaded shell/env.zucker > tmp/shell/env.zucker
17 echo echo loaded shell/logout > tmp/shell/logout
18 echo echo loaded zsh.env.local > tmp/zsh/env.local
19 echo echo loaded zsh/rc.local > tmp/zsh/rc.local
20 echo echo loaded zsh/host/rc.zucker > tmp/zsh/host/rc.zucker
21 echo echo loaded zsh/os/rc.Darwin > tmp/zsh/os/rc.Darwin
22
23
24 function tests() {
25     source_config tmp/zsh os   rc Darwin nolocal
26     echo -n $source_file$source_file_local
27     source_config tmp/zsh host rc zucker
28     echo -n $source_file$source_file_local
29
30     source_config tmp/zsh os   env Darwin nolocal
31     echo -n $source_file$source_file_local
32     source_config tmp/zsh host env zucker
33     echo -n $source_file$source_file_local
34
35     source_config tmp/bash host rc zucker
36     echo -n $source_file$source_file_local
37
38     source_config tmp/shell "" env zucker
39     echo -n $source_file$source_file_local
40
41     source_config tmp/shell "" logout
42     echo -n $source_file$source_file_local
43     source_config tmp/shell "" doesnt-exist
44     echo -n $source_file$source_file_local
45 }
46
47 # Run tests without and with debug output.
48 tests
49 echo
50 DEBUG=1 tests
51
52 # vim: ft=sh