PageRenderTime 21ms CodeModel.GetById 12ms app.highlight 2ms RepoModel.GetById 2ms app.codeStats 0ms

/test/language/unclassified/test_rename_file.e

http://github.com/tybor/Liberty
Specman e | 64 lines | 35 code | 7 blank | 22 comment | 2 complexity | d79e9d9ea9f322b849c35ea2b212d50d MD5 | raw file
 1-- This file is part of SmartEiffel The GNU Eiffel Compiler Tools and Libraries.
 2-- See the Copyright notice at the end of this file.
 3--
 4class TEST_RENAME_FILE
 5
 6create {}
 7   make
 8
 9feature {ANY}
10   core1: STRING "core1.tmp"
11
12   core2: STRING "core2.tmp"
13
14   make
15      local
16         tfw: TEXT_FILE_WRITE
17      do
18         if (create {FILE_TOOLS}).is_readable(core1) then
19            (create {FILE_TOOLS}).delete(core1)
20         end
21         assert(not (create {FILE_TOOLS}).is_readable(core1))
22         create tfw.connect_to(core1)
23         tfw.disconnect
24         assert((create {FILE_TOOLS}).is_readable(core1))
25         (create {FILE_TOOLS}).rename_to(core1, core2)
26         assert((create {FILE_TOOLS}).is_readable(core2))
27         assert(not (create {FILE_TOOLS}).is_readable(core1))
28         (create {FILE_TOOLS}).delete(core2)
29         assert(not (create {FILE_TOOLS}).is_readable(core2))
30      end
31
32   assert (b: BOOLEAN)
33      do
34         cpt := cpt + 1
35         if not b then
36            std_output.put_string("TEST_RENAME_FILE: ERROR Test # ")
37            std_output.put_integer(cpt)
38            std_output.put_string("%N")
39         else
40            --std_output.put_string("Yes%N");
41         end
42      end
43
44   cpt: INTEGER
45
46end -- class TEST_RENAME_FILE
47--
48-- ------------------------------------------------------------------------------------------------------------------------------
49-- Copyright notice below. Please read.
50--
51-- SmartEiffel is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License,
52-- as published by the Free Software Foundation; either version 2, or (at your option) any later version.
53-- SmartEiffel is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY; without even the implied warranty
54-- of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have
55-- received a copy of the GNU General Public License along with SmartEiffel; see the file COPYING. If not, write to the Free
56-- Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
57--
58-- Copyright(C) 1994-2002: INRIA - LORIA (INRIA Lorraine) - ESIAL U.H.P.       - University of Nancy 1 - FRANCE
59-- Copyright(C) 2003-2006: INRIA - LORIA (INRIA Lorraine) - I.U.T. Charlemagne - University of Nancy 2 - FRANCE
60--
61-- Authors: Dominique COLNET, Philippe RIBET, Cyril ADRIAN, Vincent CROIZIER, Frederic MERIZEN
62--
63-- http://SmartEiffel.loria.fr - SmartEiffel@loria.fr
64-- ------------------------------------------------------------------------------------------------------------------------------