]> git.donarmstrong.com Git - lilypond.git/blob - flower/test-file-path.cc
Merge branch 'master' of git+ssh://git.sv.gnu.org/srv/git/lilypond
[lilypond.git] / flower / test-file-path.cc
1 #include "file-path.hh"
2
3 #include "yaffut.hh"
4 #include "config.hh"
5
6 TEST (File_path, Find)
7 {
8   char const *extensions[] = {"ly", "", 0};
9   string file = "init";
10   char cwd[PATH_MAX];
11   getcwd (cwd, PATH_MAX);
12   string ly_dir = string (getenv ("top-src-dir")) + "/ly";
13   parse_path (string (1, PATHSEP) + ly_dir);
14   string file_name = find (file, extensions);
15   EQUAL (file_name.substr (file_name.rfind ('/')), "/init.ly");
16   file = "init.ly";
17   file_name = find (file, extensions);
18   EQUAL (file_name, ly_dir + "/init.ly");
19 }