File tree Expand file tree Collapse file tree 1 file changed +35
-1
lines changed Expand file tree Collapse file tree 1 file changed +35
-1
lines changed Original file line number Diff line number Diff line change @@ -118,4 +118,38 @@ BOOST_AUTO_TEST_CASE(fsbridge_fstream)
118118 }
119119}
120120
121- BOOST_AUTO_TEST_SUITE_END ()
121+ BOOST_AUTO_TEST_CASE (rename)
122+ {
123+ const fs::path tmpfolder{m_args.GetDataDirBase ()};
124+
125+ const fs::path path1{GetUniquePath (tmpfolder)};
126+ const fs::path path2{GetUniquePath (tmpfolder)};
127+
128+ const std::string path1_contents{" 1111" };
129+ const std::string path2_contents{" 2222" };
130+
131+ {
132+ std::ofstream file{path1};
133+ file << path1_contents;
134+ }
135+
136+ {
137+ std::ofstream file{path2};
138+ file << path2_contents;
139+ }
140+
141+ // Rename path1 -> path2.
142+ BOOST_CHECK (RenameOver (path1, path2));
143+
144+ BOOST_CHECK (!fs::exists (path1));
145+
146+ {
147+ std::ifstream file{path2};
148+ std::string contents;
149+ file >> contents;
150+ BOOST_CHECK_EQUAL (contents, path1_contents);
151+ }
152+ fs::remove (path2);
153+ }
154+
155+ BOOST_AUTO_TEST_SUITE_END ()
You can’t perform that action at this time.
0 commit comments