WARNING! Access to this system is limited to authorised users only.
Unauthorised users may be subject to prosecution.
Unauthorised access to this system is a criminal offence under Australian law (Federal Crimes Act 1914 Part VIA)
It is a criminal offence to:
(1) Obtain access to data without authority. -Penalty 2 years imprisonment.
(2) Damage, delete, alter or insert data without authority. -Penalty 10 years imprisonment.
User activity is monitored and recorded. Anyone using this system expressly consents to such monitoring and recording.

To protect your data, the CISO officer has suggested users to enable 2FA as soon as possible.
Currently 2.7% of users enabled 2FA.

Commit d2d33e9e authored by Stefan Marr's avatar Stefan Marr
Browse files

Added unit test for basic String functions


Signed-off-by: default avatarStefan Marr <git@stefan-marr.de>
parent 92acae04
StringTest = (
run: harness = (
| str |
str := '1234567890'.
str = '1234567890' ifFalse: [
harness fail: self because: '#= gives wrong result for literals'].
str length = 10 ifFalse: [
harness fail: self because: '#length gives wrong result'].
str + str = '12345678901234567890' ifFalse: [
harness fail: self because: '#+ gives wrong result'].
(str charAt: 1) = '1' ifFalse: [
harness fail: self because: '#charAt: gives wrong result. Expected 1, got: ' + (str charAt: 1)].
(str charAt: 7) = '7' ifFalse: [
harness fail: self because: '#charAt: gives wrong result'].
(str beginsWith: '23') ifTrue: [
harness fail: self because: '#beginsWith: gives wrong result'].
(str beginsWith: '123') ifFalse: [
harness fail: self because: '#beginsWith: gives wrong result'].
(str substringFrom: 2 to: 4) = '234' ifFalse: [
harness fail: self because: '#substringFrom:to: gives wrong result'].
)
)
\ No newline at end of file
......@@ -43,6 +43,7 @@ TestHarness = (
SuperTest,
SymbolTest,
VectorTest,
StringTest,
BlockTest
)
......
......@@ -24,6 +24,7 @@ class SomTest(unittest.TestCase):
("SelfBlock" ,),
("Super" ,),
("String" ,),
("Symbol" ,),
("Vector" ,)])
def test_som_test(self, test_name):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment