]> git.donarmstrong.com Git - lilypond.git/blob - flower/test-file-path.cc
Merge branch 'lilypond/translation' into staging
[lilypond.git] / flower / test-file-path.cc
1 #include "file-path.hh"
2
3 #include <limits.h>
4
5 #include "yaffut.hh"
6 #include "config.hh"
7
8 TEST (File_path, Find)
9 {
10   char const *extensions[] = {"ly", "", 0};
11   string file = "init";
12   char cwd[PATH_MAX];
13   if (!getcwd (cwd, PATH_MAX))
14     {
15       cerr << "Could not get current work directory\n";
16       exit (1);
17     }
18   string ly_dir = string (getenv ("top-src-dir")) + "/ly";
19   parse_path (string (1, PATHSEP) + ly_dir);
20   string file_name = find (file, extensions);
21   EQUAL (file_name.substr (file_name.rfind ('/')), "/init.ly");
22   file = "init.ly";
23   file_name = find (file, extensions);
24   EQUAL (file_name, ly_dir + "/init.ly");
25 }