Skip to content

Commit e6ac4ea

Browse files
authored
Merge pull request #511 from Jafaral/unittest
Enable a few tests
2 parents 45724c7 + c6eadc8 commit e6ac4ea

File tree

8 files changed

+190
-2
lines changed

8 files changed

+190
-2
lines changed

tests/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ E=/bin/echo
55
# define UC if it is not defined already
66
UC?=../bin/unicon
77

8-
TESTS=general posix thread pattern mt unicon
8+
TESTS=general posix thread pattern mt unicon coexpr lib
99

1010
# The default is to run all tests, using icont.
1111

tests/lib/Makefile

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#
2+
# lib test
3+
#
4+
5+
6+
include ../Makedefs
7+
8+
TARGETS=$(patsubst %.icn,%,$(wildcard *.icn))
9+
SKIP=property_demo
10+
IGNORE=unittest
11+
12+
# Do the tests
13+
Test: DoTest
14+
15+
include ../Makefile.test

tests/lib/stand/class_static.std

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
In instance b, var is 5
2+
In instance a, var is 1
3+
In instance a, var is &null

tests/lib/stand/jsontests.std

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
Unicon table encoding test: SUCCESS
2+
Unicon set encoding test: SUCCESS
3+
Unicon cset encoding test: SUCCESS
4+
Unicon record encoding test: SUCCESS
5+
Unicon class encoding test: SUCCESS
6+
Object test: SUCCESS
7+
JSON Unicon object encoding test: SUCCESS
8+
Unicon escapes & control characters test: SUCCESS
9+
Unicon escape & control sequence test: SUCCESS
10+
schema tests:
11+
schema test valid:SUCCESS
12+
schema test invalid:SUCCESS
13+
schema test invalid:SUCCESS
14+
schema test invalid:SUCCESS
15+
schema test invalid:SUCCESS

tests/lib/stand/objecttests.std

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
Check to see if d is an instance of Object.
2+
3+
d is an instance of Object
4+
5+
Test string invocation of method names...should see '123'
6+
123
7+
8+
And now nested invokes...should still see '123'
9+
123
10+
11+
List all the methods in class D...
12+
13+
write
14+
clone
15+
to_string
16+
equals
17+
hash_code
18+
get_class_name
19+
get_id
20+
get_class
21+
is_instance
22+
Type
23+
instanceOf
24+
className
25+
invoke
26+
getField
27+
setField
28+
hasField
29+
fieldNames
30+
genMethods
31+
hasMethod
32+
33+
Check the inheritance hierarchy
34+
35+
ATest is an instance of ATest
36+
ATest is NOT an instance of Test::ATest
37+
ATest is an instance of Object
38+
ATest is NOT an instance of BTest
39+
BTest is an instance of ATest
40+
BTest is an instance of BTest
41+
CTest is an instance of Object
42+
CTest is NOT an instance of ATest
43+
DTest is an instance of Object
44+
DTest is an instance of ATest
45+
DTest is NOT an instance of BTest
46+
DTest is an instance of CTest
47+
ETest is NOT an instance of Class
48+
ETest is an instance of Object
49+
ETest is an instance of FTest
50+
FTest is an instance of ETest
51+
52+
d inherits from: DTest ATest CTest lang::Object
53+
54+
e inherits from: ETest FTest lang::Object ETest
55+
56+
g fields: one two three
57+
h fields: four five six one two three
58+
h.one -> 1
59+
h.one -> One
60+
Attempt to set non-existent field: ok - field doesn't exist

tests/lib/stand/singleton.std

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
2+
in constructor
3+
hi there!
4+
5+
Once more, with feeling...
6+
7+
hi there!
8+
9+
And again, after assignment...
10+
11+
hi there!

tests/lib/stand/unittest.std

+84
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
TestTestSuite_testInitialState
2+
3+
TestTestSuite_testAddTest
4+
5+
TestTestSuite_testAddNonTest
6+
7+
TestTestSuite_testRunTests
8+
=== TEST SUMMARY ===
9+
passed: 0, failed: 0
10+
ran 0 tests in 0.000001s
11+
SimpleTest_testAssertEqual
12+
13+
SimpleTest_testAssert
14+
15+
=== TEST SUMMARY ===
16+
passed: 2, failed: 0
17+
ran 2 tests in 0.000140s
18+
19+
TestTestSuite_testRuntime
20+
SlowTest_testSlow
21+
22+
=== TEST SUMMARY ===
23+
passed: 1, failed: 0
24+
ran 1 tests in 2.001025s
25+
26+
TestTestSuite_testRunFailureTests
27+
FailureTest_testFailAssertEqual
28+
Assertion failed: expected 0, but got 9
29+
Assertion failed: expected Unicon, but got Icon
30+
31+
FailureTest_testFailAssertNotEqual
32+
Assertion failed: unexpected 0, but got 0
33+
Assertion failed: unexpected Unicon, but got Unicon
34+
35+
FailureTest_testFailAssert
36+
Assertion failed.
37+
Assertion failed.
38+
Assertion failed.
39+
Assertion failed.
40+
41+
=== TEST SUMMARY ===
42+
passed: 0, failed: 3
43+
ran 3 tests in 0.000441s
44+
45+
TestTestCase_testInitialState
46+
47+
TestTestCase_testResetStatus
48+
49+
TestTestCase_testAssertEqual
50+
51+
TestTestCase_testAssertNotEqual
52+
53+
TestTestCase_testAssert
54+
55+
TestTestCase_testAssertFail
56+
57+
TestMock_testInitialState
58+
59+
TestMock_testExpect
60+
61+
TestMock_testVerify
62+
63+
TestMock_testInvoke
64+
65+
TestTestReporter_testInitialState
66+
67+
TestTestReporter_testResult
68+
69+
TestTestReporter_testRuntime
70+
71+
TestTestReporter_testSummary
72+
=== TEST SUMMARY ===
73+
passed: 0, failed: 0
74+
ran 0 tests in 0.000000s
75+
=== TEST SUMMARY ===
76+
passed: 1, failed: 0
77+
ran 1 tests in 0.000000s
78+
=== TEST SUMMARY ===
79+
passed: 1, failed: 1
80+
ran 2 tests in 0.000000s
81+
82+
=== TEST SUMMARY ===
83+
passed: 20, failed: 0
84+
ran 20 tests in 2.003867s

uni/lib/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ UFILES=gui.u file_dlg.u db.u \
1818
undoableedit.u undomanager.u url.u webup.u \
1919
notification.u md5.u httprequest.u httpresponse.u exception.u \
2020
thread.u matrix_util.u struct.u db_util.u database.u addressdb.u \
21-
union.u pdb_util.u propertydb.u property.u utf8.u
21+
union.u pdb_util.u propertydb.u property.u utf8.u unittest.u
2222

2323
# COPYINS are library files copied in from other directories for
2424
# organizational purposes. Inspired by ipl/lib. They have to be

0 commit comments

Comments
 (0)