1 #define HAVE_BOOST_LAMBDA 1
2 #include "std-vector.hh"
7 #include <boost/test/auto_unit_test.hpp>
8 #include <boost/test/floating_point_comparison.hpp>
11 using boost::unit_test::test_suite;
13 #include "file-name.hh"
14 string slashify (string file_name);
17 //BOOST_AUTO_UNIT_TEST (mingw_slashify)
18 void mingw_slashify ()
20 File_name f = string ("foe.ly");
21 string s = slashify (f.to_string ());
23 BOOST_CHECK_EQUAL (s, "foe.ly");
24 f = string ("/tmp/x.ly");
25 s = slashify (f.to_string ());
27 BOOST_CHECK_EQUAL (s, "/tmp/x.ly");
28 f = string ("c:/tmp/x.ly");
29 s = slashify (f.to_string ());
31 BOOST_CHECK_EQUAL (s, "c:/tmp/x.ly");
32 f = string ("\\tmp\\x.ly");
33 s = slashify (f.to_string ());
35 BOOST_CHECK_EQUAL (s, "/tmp/x.ly");
39 #include "file-path.hh"
42 //BOOST_AUTO_UNIT_TEST (mingw_slashify)
45 char const *extensions[] = {"ly", "", 0};
49 getcwd (cwd, PATH_MAX);
50 string ly_dir = string (getenv ("LILYPONDPREFIX")) + "/ly";
51 cout << ly_dir << endl;
52 path.parse_path (string (1, PATHSEP) + ly_dir);
53 string file_name = path.find (file, extensions);
54 cout << file_name << endl;
55 BOOST_CHECK_EQUAL (file_name.substr (file_name.rfind ('/')), "/init.ly");
57 file_name = path.find (file, extensions);
58 cout << file_name << endl;
59 BOOST_CHECK_EQUAL (file_name, ly_dir + "/init.ly");