author | Jan Vrany <jan.vrany@labware.com> |
Mon, 08 Mar 2021 11:25:35 +0000 | |
branch | jv |
changeset 2594 | e5f39c0a5bd6 |
parent 1567 | e17701a073f9 |
permissions | -rwxr-xr-x |
1447 | 1 |
"{ Package: 'stx:goodies/regression' }" |
330 | 2 |
|
3 |
"{ NameSpace: RegressionTests }" |
|
4 |
||
5 |
TestCase subclass:#URLTest |
|
6 |
instanceVariableNames:'' |
|
7 |
classVariableNames:'' |
|
8 |
poolDictionaries:'' |
|
9 |
category:'tests-Regression' |
|
10 |
! |
|
11 |
||
12 |
||
13 |
!URLTest methodsFor:'testing'! |
|
14 |
||
15 |
test01_fromString |
|
16 |
|u| |
|
17 |
||
18 |
u := URL fromString:'foo'. |
|
19 |
self assert:u host isNil. |
|
20 |
self assert:u path = 'foo'. |
|
21 |
self assert:u method isNil. |
|
22 |
self assert:u port isNil. |
|
23 |
||
24 |
u := URL fromString:'fff/'. |
|
25 |
self assert:u host isNil. |
|
26 |
self assert:u path = 'fff/'. |
|
27 |
self assert:u method isNil. |
|
28 |
self assert:u port isNil. |
|
29 |
||
30 |
u := URL fromString:'localhost:8080/'. |
|
31 |
self assert:u host = 'localhost'. |
|
32 |
self assert:u path isEmptyOrNil. |
|
33 |
self assert:u method isNil. |
|
34 |
self assert:u port = 8080. |
|
35 |
||
36 |
u := URL fromString:'http://localhost/'. |
|
37 |
self assert:u host = 'localhost'. |
|
38 |
self assert:u path isEmptyOrNil. |
|
39 |
self assert:u method = 'http'. |
|
40 |
||
41 |
u := URL fromString:'http://www.exept.de/'. |
|
42 |
self assert:u host = 'www.exept.de'. |
|
43 |
self assert:u path isEmptyOrNil. |
|
44 |
self assert:u method = 'http'. |
|
45 |
||
46 |
" |
|
47 |
self new test01_fromString |
|
48 |
" |
|
49 |
! |
|
50 |
||
51 |
test02_construct |
|
52 |
|u1 u2| |
|
53 |
||
54 |
u1 := URL fromString:'http://localhost/'. |
|
55 |
||
56 |
u2 := u1 construct:'subdir1'. |
|
57 |
self assert:u2 host = 'localhost'. |
|
58 |
self assert:u2 path = '/subdir1'. |
|
59 |
self assert:u2 method = 'http'. |
|
60 |
self assert:u2 port isNil. |
|
61 |
||
62 |
u2 := u1 construct:'/subdir1'. |
|
63 |
self assert:u2 host = 'localhost'. |
|
64 |
self assert:u2 path = '/subdir1'. |
|
65 |
self assert:u2 method = 'http'. |
|
66 |
self assert:u2 port isNil. |
|
67 |
||
68 |
u2 := u1 construct:'http://www.google.de:/top.html'. |
|
69 |
self assert:u2 host = 'www.google.de'. |
|
70 |
self assert:u2 path = '/top.html'. |
|
71 |
self assert:u2 method = 'http'. |
|
72 |
self assert:u2 port isNil. |
|
73 |
||
74 |
" |
|
75 |
self new test02_construct |
|
76 |
" |
|
77 |
! ! |
|
78 |
||
79 |
!URLTest class methodsFor:'documentation'! |
|
80 |
||
81 |
version |
|
82 |
^ '$Header$' |
|
83 |
! ! |
|
1567
e17701a073f9
Added abstract VMSpawningTestCase
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1447
diff
changeset
|
84 |