/[eiffelstudio]/trunk/eweasel/tests/lib006/test.e
ViewVC logotype

Contents of /trunk/eweasel/tests/lib006/test.e

Parent Directory Parent Directory | Revision Log Revision Log


Revision 65297 - (show annotations)
Thu Nov 30 20:22:33 2006 UTC (13 years ago) by manus
File size: 1460 byte(s)
Moved from trunk/Src/eweasel to trunk/eweasel so that a simple checkout of the source code is not penalized by the lenghty process of checking out all the tests of eweasel.
1 class TEST
2 create
3 make
4 feature
5 make is
6 do
7 test_hash_code
8 test_justify
9 end
10
11 feature {NONE}
12
13 test_hash_code is
14 local
15 s: STRING
16 hash_code: INTEGER
17 c_string: C_STRING
18 do
19 s := "This is a test"
20 hash_code := s.hash_code
21 s.make (0)
22 io.put_boolean (s.hash_code = hash_code)
23 io.put_new_line
24
25 s := "This is a test"
26 hash_code := s.hash_code
27 s.make_empty
28 io.put_boolean (s.hash_code = hash_code)
29 io.put_new_line
30
31 s := "This is a test"
32 hash_code := s.hash_code
33 s.make_filled (' ', 0)
34 io.put_boolean (s.hash_code = hash_code)
35 io.put_new_line
36
37 s := "This is a test"
38 hash_code := s.hash_code
39 s.make_from_string ("")
40 io.put_boolean (s.hash_code = hash_code)
41 io.put_new_line
42
43 s := "This is a test"
44 hash_code := s.hash_code
45 create c_string.make ("")
46 s.make_from_c (c_string.item)
47 io.put_boolean (s.hash_code = hash_code)
48 io.put_new_line
49
50 s := "This is a test"
51 hash_code := s.hash_code
52 create c_string.make ("")
53 s.from_c (c_string.item)
54 io.put_boolean (s.hash_code = hash_code)
55 io.put_new_line
56
57 s := "This is a test"
58 hash_code := s.hash_code
59 create c_string.make ("")
60 s.from_c_substring (c_string.item, 1, 1)
61 io.put_boolean (s.hash_code = hash_code)
62 io.put_new_line
63 end
64
65 test_justify is
66 local
67 s: STRING
68 do
69 s := "123456"
70 s.left_justify
71 io.put_boolean (s.substring (1, 6).is_equal ("123456"))
72 io.put_new_line
73 end
74
75 end

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.23