You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Who are you targeting with this package? The language developers? or the language users, writing their own applications in Unicon and using the package to write tests? If it is the former, then it should go under unicon/tests/, if it is the latter (or both), then it should go under uniccon/uni/lib. The test itself should go under under unicon/tests/lib or unicon/tests/unicon.
I haven't programmed in Icon since Ralph Griswold passed away and only few weeks with Unicon. There are most certainly a few things I would like to improve upon. Bootstrapping is the highlight at the moment, since the unittest package is used to test the unittest package. Looking forward to your feedback.
There is a working version updated in the draft with a reasonable test coverage. There is still a bit of work to do but the question is this worthy of a PR?
The output looks like the following. exit(ts.run()) ensures that if one or more test fail, the build will fail.
TestTestSuite_testInitialState
TestTestSuite_testAddTest
TestTestSuite_testAddNonTest
TestTestSuite_testRunTests
=== TEST SUMMARY ===
passed: 0, failed: 0
ran 0 tests in 0.000000s
SimpleTest_testAssertEqual
SimpleTest_testAssert
=== TEST SUMMARY ===
passed: 2, failed: 0
ran 2 tests in 0.000092s
TestTestSuite_testRuntime
SlowTest_testSlow
=== TEST SUMMARY ===
passed: 1, failed: 0
ran 1 tests in 2.001685s
TestTestSuite_testRunFailureTests
FailureTest_testFailAssertEqual
Assertion failed: expected 0, but got 9
Assertion failed: expected Unicon, but got Icon
FailureTest_testFailAssertNotEqual
Assertion failed: unexpected 0, but got 0
Assertion failed: unexpected Unicon, but got Unicon
FailureTest_testFailAssert
Assertion failed.
Assertion failed.
Assertion failed.
Assertion failed.
=== TEST SUMMARY ===
passed: 0, failed: 3
ran 3 tests in 0.000122s
TestTestCase_testInitialState
TestTestCase_testResetStatus
TestTestCase_testAssertEqual
TestTestCase_testAssertNotEqual
TestTestCase_testAssert
TestTestCase_testAssertFail
TestMock_testInitialState
TestMock_testExpect
TestMock_testVerify
TestMock_testInvoke
TestTestReporter_testInitialState
TestTestReporter_testResult
TestTestReporter_testRuntime
TestTestReporter_testSummary
=== TEST SUMMARY ===
passed: 0, failed: 0
ran 0 tests in 0.000000s
=== TEST SUMMARY ===
passed: 1, failed: 0
ran 1 tests in 0.000000s
=== TEST SUMMARY ===
passed: 1, failed: 1
ran 2 tests in 0.000000s
=== TEST SUMMARY ===
passed: 20, failed: 0
ran 20 tests in 2.002867s
Is it possible to dynamically create methods and fields for a class? It would be helpful for the mocking of objects. What I have done at the moment is working but it's not as convenient as it could be.
Activity
Jafaral commentedon Apr 19, 2024
Can you open a draft PR with these for easy review and inline feedback?
IanTrudel commentedon Apr 19, 2024
What workflow do you suggest? Clone or fork and then submit a PR?
Which directory should these files go? unittest.icn is the package and tests.icn is the unit tests testing unittest package.
Jafaral commentedon Apr 20, 2024
We use Fork/PR workflow (here ).
Who are you targeting with this package? The language developers? or the language users, writing their own applications in Unicon and using the package to write tests? If it is the former, then it should go under
unicon/tests/, if it is the latter (or both), then it should go underuniccon/uni/lib. The test itself should go under underunicon/tests/liborunicon/tests/unicon.IanTrudel commentedon Apr 20, 2024
There you go, as you requested! #432
I haven't programmed in Icon since Ralph Griswold passed away and only few weeks with Unicon. There are most certainly a few things I would like to improve upon. Bootstrapping is the highlight at the moment, since the unittest package is used to test the unittest package. Looking forward to your feedback.
Jafaral commentedon Apr 20, 2024
Thank you @IanTrudel. We would love to grow the community and have more people contribute to Unicon.
IanTrudel commentedon Apr 27, 2024
There is a working version updated in the draft with a reasonable test coverage. There is still a bit of work to do but the question is this worthy of a PR?
The output looks like the following.
exit(ts.run())ensures that if one or more test fail, the build will fail.IanTrudel commentedon Jun 8, 2024
Is it possible to dynamically create methods and fields for a class? It would be helpful for the mocking of objects. What I have done at the moment is working but it's not as convenient as it could be.