1 #define HAVE_BOOST_LAMBDA 1
2 #include "std-vector.hh"
6 #include <boost/test/auto_unit_test.hpp>
7 #include <boost/test/floating_point_comparison.hpp>
10 using boost::unit_test::test_suite;
12 #include "file-name.hh"
13 string slashify (string file_name);
16 //BOOST_AUTO_UNIT_TEST (mingw_slashify)
17 void mingw_slashify ()
19 File_name f = string ("foe.ly");
20 string s = slashify (f.to_string ());
22 BOOST_CHECK_EQUAL (s, "foe.ly");
23 f = string ("/tmp/x.ly");
24 s = slashify (f.to_string ());
26 BOOST_CHECK_EQUAL (s, "/tmp/x.ly");
27 f = string ("c:/tmp/x.ly");
28 s = slashify (f.to_string ());
30 BOOST_CHECK_EQUAL (s, "c:/tmp/x.ly");
31 f = string ("\\tmp\\x.ly");
32 s = slashify (f.to_string ());
34 BOOST_CHECK_EQUAL (s, "/tmp/x.ly");
38 #include "file-path.hh"
41 //BOOST_AUTO_UNIT_TEST (mingw_slashify)
44 char const *extensions[] = {"ly", "", 0};
48 getcwd (cwd, PATH_MAX);
49 string ly_dir = string (getenv ("LILYPONDPREFIX")) + "/ly";
50 cout << ly_dir << endl;
51 path.parse_path (string (1, PATHSEP) + ly_dir);
52 string file_name = path.find (file, extensions);
53 cout << file_name << endl;
54 BOOST_CHECK_EQUAL (file_name.substr (file_name.rfind ('/')), "/init.ly");
56 file_name = path.find (file, extensions);
57 cout << file_name << endl;
58 BOOST_CHECK_EQUAL (file_name, ly_dir + "/init.ly");