LEFT | RIGHT |
(no file at all) | |
1 #include "file-path.hh" | 1 #include "file-path.hh" |
2 | 2 |
3 #include <limits.h> | 3 #include <limits.h> |
4 | 4 |
| 5 #include "config.hh" |
5 #include "yaffut.hh" | 6 #include "yaffut.hh" |
6 #include "config.hh" | |
7 | 7 |
8 TEST (File_path, Find) | 8 TEST (File_path, Find) |
9 { | 9 { |
10 char const *extensions[] = {"ly", "", 0}; | 10 char const *extensions[] = {"ly", "", 0}; |
11 string file = "init"; | 11 string file = "init"; |
12 char cwd[PATH_MAX]; | 12 char cwd[PATH_MAX]; |
13 getcwd (cwd, PATH_MAX); | 13 getcwd (cwd, PATH_MAX); |
14 string ly_dir = string (getenv ("top-src-dir")) + "/ly"; | 14 string ly_dir = string (getenv ("top-src-dir")) + "/ly"; |
15 parse_path (string (1, PATHSEP) + ly_dir); | 15 parse_path (string (1, PATHSEP) + ly_dir); |
16 string file_name = find (file, extensions); | 16 string file_name = find (file, extensions); |
17 EQUAL (file_name.substr (file_name.rfind ('/')), "/init.ly"); | 17 EQUAL (file_name.substr (file_name.rfind ('/')), "/init.ly"); |
18 file = "init.ly"; | 18 file = "init.ly"; |
19 file_name = find (file, extensions); | 19 file_name = find (file, extensions); |
20 EQUAL (file_name, ly_dir + "/init.ly"); | 20 EQUAL (file_name, ly_dir + "/init.ly"); |
21 } | 21 } |
LEFT | RIGHT |