diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2009-09-27 18:15:49 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2009-09-27 18:15:49 +0200 |
commit | c5e49023abc9d4d1a348588aa7ce743f6af0cf41 (patch) | |
tree | d1228216b4f8db1dcbb3d38e664d30a2dd666cea /tests/parser | |
parent | b3ab9d53c47ad5f7c35ac12b2577c589cf4e0d20 (diff) | |
download | cli-c5e49023abc9d4d1a348588aa7ce743f6af0cf41.tar.gz cli-c5e49023abc9d4d1a348588aa7ce743f6af0cf41.tar.xz cli-c5e49023abc9d4d1a348588aa7ce743f6af0cf41.zip |
Pass file name as path
Diffstat (limited to 'tests/parser')
-rw-r--r-- | tests/parser/driver.cxx | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/parser/driver.cxx b/tests/parser/driver.cxx index ea7b003..c351d5b 100644 --- a/tests/parser/driver.cxx +++ b/tests/parser/driver.cxx @@ -22,12 +22,20 @@ int main (int argc, char* argv[]) try { + semantics::path path (argv[1]); + ifstream ifs; ifs.exceptions (ifstream::failbit | ifstream::badbit); - ifs.open (argv[1]); + ifs.open (path.string ().c_str ()); parser p; - p.parse (ifs, argv[1]); + p.parse (ifs, path); + } + catch (semantics::invalid_path const& e) + { + cerr << "error: '" << e.path () << "' is not a valid filesystem path" + << endl; + return 1; } catch (parser::invalid_input const&) { |