It includes functionality for
strings, decimals, lists, dictionaries, type conversion,
and Behavior Driven Development. It
works with DMD using D version 2.0.
Here is a basic example:
import dlang_helper;
int main() {
// Decimal
decimal f = decimal(12, 78, 18, 18); // 12.000000000000000078
// Type conversion
int a = "7".to_int;
string b = 7.to_s;
// Behavior Driven Development
unittest {
describe("libhelper#blah",
it("Should be 7", delegate() {
a.should_equal(7);
}),
it("Should not be 8", delegate() {
a.should_not_equal(8);
})
);
}
return 0;
}
Status:
It currently only works on Linux and BSD, but should soon work
on other Operating Systems.
Getting started:
Install D Lang Helper per the instructions above.
Here is a basic program that will raise an unhandled
exception saying that 6 is not equal to 7:
# Install the D compiler
# http://dlang.org/download.html
# Install D Lang Helper 0.3.3
wget https://launchpad.net/dlanghelper/trunk/0.3.3/+download/dlanghelper-0.3.3.tar.gz
tar -zxvf dlanghelper-0.3.3.tar.gz
cd dlanghelper-0.3.3
sudo ./raise install
# Run the test suite
./raise test
Download for BSD:
# Install the D compiler
# http://dlang.org/download.html
# Install D Lang Helper 0.3.3
wget https://launchpad.net/dlanghelper/trunk/0.3.3/+download/dlanghelper-0.3.3.tar.gz
tar -zxvf dlanghelper-0.3.3.tar.gz
cd dlanghelper-0.3.3
sudo ./raise install
# Run the test suite
./raise test
Download for Open Indiana:
The DMD compiler does not yet work on Open Indiana.
# Install the D compiler
# http://dlang.org/download.html
# Install D Lang Helper
bzr branch lp:dlanghelper
cd dlanghelper
sudo ./raise install
# Run the test suite
./raise test
Bug reports can be filed and checked at launchpad.
Individual project authors and their contact information can be found in the
COPYRIGHT
file.
If you need to contact someone regarding this project, you can email Matt Jones:
matt jones at workhorsy dot org