Why `#import("dart:unittest")` can't run?
dart, unit-testing
Solution
Unfortunately, the unittest library is not yet wired into the dart: namespace. Until that happens, if it ever happens, you'll need to use a relative path to get to the unittest library.
Something like:
#import('path-to-dart/lib/unittest/unitest.dart');
More examples are here: http://api.dartlang.org/unittest.html
Problem
I write some dart test code: ``` #import("dart:unittest"); main() { test('this is a test', () { int x = 2+3; expect(x).equals(5); }); } ``` It doesn't display any error in dart editor, but when I press the "run" button, it reports: ``` Do not know how to load 'dart:unittest''file:///home/freewind/dev/dart/editor /samples/shuzu.org/test/model_test.dart': Error: line 1 pos 1: library handler failed #import("dart:unittest"); ^ ``` I see there is a "dart:unittest" library in my dart-sdk. Why it can't be run?