We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]
Rating:
Author: VCC
Last Updated: 2024-04-22
Package Version: 1.0.0.0
Category: Other Codes
Downloaded: 39 times
Not followed.
License: MIT license
This is a small library with testing functions, inspired by Jasmine testing framework. It supports several datatypes for writing tests, like String, Integer, DWord, Boolean and raw data. There is also a counterpart library for desktop applications. The provided examples test the DynArrays library.
Do you want to subscribe in order to receive notifications regarding "Expectations" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "Expectations" changes.
Do you want to report abuse regarding "Expectations".
DOWNLOAD LINK | RELATED COMPILER | CONTAINS |
---|---|---|
1713765356_expectations_mikropascal_pic32.zip [82.53KB] | mikroPascal PRO for PIC32 |
|
Expectations is a library, which provides several functions, which can be used in writing tests. So far, the supported datatypes are: String, Integer, DWord, Boolean and raw data.
Tested library by included projects: DynArrays
Example:
procedure TTestDynArrays_TestWritingToArray; var Arr: TDynArrayOfByte; begin InitDynArrayToEmpty(Arr); SetDynLength(Arr, 20); Arr.Content^[17] := 80; ExpectDWord(Arr.Content^[17]).ToBe(80, ''); FreeDynArray(Arr); end; procedure TTestDynArrays_TestReallocationToLargerArray; var Arr: TDynArrayOfByte; i: Integer; begin InitDynArrayToEmpty(Arr); ExpectBoolean(SetDynLength(Arr, 20)).ToBe(True, ''); for i := 0 to DynLength(Arr) - 1 do Arr.Content^[i] := i * 10; ExpectBoolean(SetDynLength(Arr, 30)).ToBe(True, 'expecting successful reallocation'); for i := 0 to 20 - 1 do //test up to the old length, as this content has to be valid only ExpectDWord(Arr.Content^[i]).ToBe(DWord(i * 10), ''); FreeDynArray(Arr); end;
The test results are reported through UART. (See included example projects)