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