Skip to content

Feature request: actually run tests #252

@sigurdm

Description

@sigurdm

It would be awesome to be able to write tests like:

/// ```dart#test
/// assert(add2(3) == 6);
/// ```
int add2(int x) => x+2

And have the code actually run as a test something like:

> dart test
00:02 +0 -1: test/dartdoc_test.dart: [dartdoc_test] lib/abc.dart test for error [E] 
'abc.dart': Failed assertion: line 1 pos 10: 'add2(3) == 6': is not true.
#0      _AssertionError._doThrowNew (dart:core-patch/errors_patch.dart:50:61)
#1      _AssertionError._throwNew (dart:core-patch/errors_patch.dart:40:5)
#2      main (file:///usr/local/google/home/sigurdm/projects/blah/ddt/bin/a.dart:2:10)
#3      _delayEntrypointInvocation.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:297:19)
#4      _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:184:12)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions