PageRenderTime 57ms CodeModel.GetById 54ms app.highlight 0ms RepoModel.GetById 1ms app.codeStats 1ms

/test/language/instruction/assignment/test_reverse_assignment.e

http://github.com/tybor/Liberty
Specman e | 63 lines | 33 code | 9 blank | 21 comment | 0 complexity | 0a447d1d0243a758db3bdaeed6a98776 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_REVERSE_ASSIGNMENT
 5
 6insert
 7   EIFFELTEST_TOOLS
 8
 9create {}
10   make
11
12feature {ANY}
13   string: STRING
14
15   animal: ANIMAL
16
17   cat: CAT
18
19   dog: DOG
20
21   any_string: ABSTRACT_STRING
22
23   make
24      do
25         any_string := "foo"
26         assert(any_string /= Void)
27         string ?= any_string
28         assert(string /= Void)
29         assert(any_string = string)
30         create dog
31         animal := dog
32         assert(dog = animal)
33         cat ?= animal
34         assert(cat = Void)
35         create cat
36         animal := cat
37         assert(cat = animal)
38         cat ?= animal
39         assert(cat /= Void)
40         animal := Void
41         cat ?= animal
42         assert(cat = Void)
43      end
44
45end -- class TEST_REVERSE_ASSIGNMENT
46--
47-- ------------------------------------------------------------------------------------------------------------------------------
48-- Copyright notice below. Please read.
49--
50-- SmartEiffel is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License,
51-- as published by the Free Software Foundation; either version 2, or (at your option) any later version.
52-- SmartEiffel is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY; without even the implied warranty
53-- of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have
54-- received a copy of the GNU General Public License along with SmartEiffel; see the file COPYING. If not, write to the Free
55-- Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
56--
57-- Copyright(C) 1994-2002: INRIA - LORIA (INRIA Lorraine) - ESIAL U.H.P.       - University of Nancy 1 - FRANCE
58-- Copyright(C) 2003-2006: INRIA - LORIA (INRIA Lorraine) - I.U.T. Charlemagne - University of Nancy 2 - FRANCE
59--
60-- Authors: Dominique COLNET, Philippe RIBET, Cyril ADRIAN, Vincent CROIZIER, Frederic MERIZEN
61--
62-- http://SmartEiffel.loria.fr - SmartEiffel@loria.fr
63-- ------------------------------------------------------------------------------------------------------------------------------