On Thursday, 3 November 2022 at 10:26:04 UTC, Imperatorn wrote:
On Thursday, 3 November 2022 at 10:00:27 UTC, Bruno Pagis wrote:
Good morning,
I have the following class:
```
class A {
int[] array;
...
void print() {
writeln("array = ", this.array);
}
}
```
I would like to unit t
On Thursday, 3 November 2022 at 10:00:27 UTC, Bruno Pagis wrote:
Good morning,
I would like to unit test the print function (yes, I know, not
very useful on the above example since print is merely a
duplicate of writeln...). Is there a way to use assert to test
the output of the print functio
On Thu, Nov 03, 2022 at 08:51:52AM -0700, Ali Çehreli via Digitalmars-d-learn
wrote:
> On 11/3/22 03:00, Bruno Pagis wrote:
>
> >void print() {
> > writeln("array = ", this.array);
> >}
>
> Similar to Paul Backus's program but I would try to avoid the file system
> for unit tests wh
On 11/3/22 03:00, Bruno Pagis wrote:
>void print() {
> writeln("array = ", this.array);
>}
Similar to Paul Backus's program but I would try to avoid the file
system for unit tests when possible. In this case, you can print into a
sink, which can be useful in other ways as well:
On Thursday, 3 November 2022 at 10:00:27 UTC, Bruno Pagis wrote:
Good morning,
I have the following class:
```
class A {
int[] array;
...
void print() {
writeln("array = ", this.array);
}
}
```
I would like to unit test the print function (yes, I know, not
very useful on the abov
On Thursday, 3 November 2022 at 10:00:27 UTC, Bruno Pagis wrote:
Good morning,
I have the following class:
```
class A {
int[] array;
...
void print() {
writeln("array = ", this.array);
}
}
```
I would like to unit test the print function (yes, I know, not
very useful on the abov
You could redirect stdout to a file of your choosing and test against that.
Although ideally you would instead take as an argument to print some
sort of output range or Appender. Then you could test against that instead.
On Friday, 22 August 2014 at 09:37:30 UTC, Robert burner Schadek
wrote:
On Friday, 22 August 2014 at 09:33:10 UTC, Kagamin wrote:
Compile and run the tests with different version options.
that is not an option
This is how version feature is intentionally designed to work
On Friday, 22 August 2014 at 09:37:30 UTC, Robert burner Schadek
wrote:
On Friday, 22 August 2014 at 09:33:10 UTC, Kagamin wrote:
Compile and run the tests with different version options.
that is not an option
Well, that's normally how it would be done. But if you need to
test them all with
On Friday, 22 August 2014 at 09:33:10 UTC, Kagamin wrote:
Compile and run the tests with different version options.
that is not an option
Compile and run the tests with different version options.
On Thursday, 26 December 2013 at 09:25:14 UTC, Dfr wrote:
If i do not want to unit test whole codebase, because it big
enough and all tests take noticeable time to run.
So i trying this:
dmd -unittest mymodule.d
And getting error: "undefined reference to `main'"
But i don't want to run 'main'
On Thursday, 26 December 2013 at 09:25:14 UTC, Dfr wrote:
If i do not want to unit test whole codebase, because it big
enough and all tests take noticeable time to run.
So i trying this:
dmd -unittest mymodule.d
And getting error: "undefined reference to `main'"
But i don't want to run 'main'
- Jonathan M Davis wrote:
>LOL. Goodness no. They're done by hand. I'm currently reworking std.datetime's
>unit tests, and it's very time consuming (since it's a large module with lots
>of tests). I don't know how you'd get a framework to generate what I want
>anyway. The fact that D has unit test
On 2011-03-28 11:29, Ishan Thilina wrote:
> @David:
>
> No, my question was not about running them,but on how that code was
> generated. I thought they were auto generated using a unitest framework
> :). Your answer clarifies everything. Thank you..! :-)
LOL. Goodness no. They're done by hand. I'
@David:
No, my question was not about running them,but on how that code was generated. I
thought they were auto generated using a unitest framework :). Your answer
clarifies everything. Thank you..! :-)
On 3/28/11 5:55 PM, Caligo wrote:
and how does one do unit testing with GDC? It works fine with DMD,
but GDC doesn't do unit testing when -unittest is supplied.
-funittest, IIRC.
David
On Mon, Mar 28, 2011 at 9:34 AM, David Nadlinger wrote:
> On 3/28/11 4:23 PM, Ishan Thilina wrote:
>>
>> I see that almost all of the phobos library files have "unittests". Were
>> these
>> unit tests were created using some framework? If so, then what is it?
>>
>> Thank you...!
>
> No, these unit
On 3/28/11 4:23 PM, Ishan Thilina wrote:
I see that almost all of the phobos library files have "unittests". Were these
unit tests were created using some framework? If so, then what is it?
Thank you...!
No, these unit test were just written by hand while writing the
corresponding pieces of c
19 matches
Mail list logo