diff --git a/lib/Messenger/src/peer.dart b/lib/Messenger/src/peer.dart index 06ebadc..e5ac8e7 100644 --- a/lib/Messenger/src/peer.dart +++ b/lib/Messenger/src/peer.dart @@ -68,7 +68,8 @@ class Peer{ //init newMessageController = new StreamController.broadcast(); - newConnectionController = new StreamController.broadcast(); + newConnectionController = + new StreamController.broadcast(); _connections = new Map(); listen_completer = new Completer(); diff --git a/tests/helloworld_test.dart b/tests/helloworld_test.dart index f43ddd2..54eaf95 100644 --- a/tests/helloworld_test.dart +++ b/tests/helloworld_test.dart @@ -2,6 +2,7 @@ library unittest.helloworld; import 'package:unittest/unittest.dart'; + main() { group('Simple Unittests to check Framework', () { @@ -14,5 +15,8 @@ main() { expect(hello, "hello world"); }); + + + }); } \ No newline at end of file diff --git a/tests/jsdatachannelconnection_test.dart b/tests/jsdatachannelconnection_test.dart index 33a8364..4fc2f39 100644 --- a/tests/jsdatachannelconnection_test.dart +++ b/tests/jsdatachannelconnection_test.dart @@ -219,18 +219,24 @@ void main() { //each sould receive two messages alice.newMessageController.stream.listen( expectAsync1((NewMessageEvent e){ + logMessage("alice received message"); + expect(e.data.toString(), s); }, count: 2) ); bob.newMessageController.stream.listen( expectAsync1((NewMessageEvent e){ + logMessage("bob received message"); + expect(e.data.toString(), s); }, count: 2) ); clark.newMessageController.stream.listen( expectAsync1((NewMessageEvent e){ + logMessage("clark received message"); + expect(e.data.toString(), s); }, count: 2) ); diff --git a/tests/selftest_test.dart b/tests/selftest_test.dart new file mode 100644 index 0000000..144391a --- /dev/null +++ b/tests/selftest_test.dart @@ -0,0 +1,30 @@ +import 'package:unittest/unittest.dart'; +import 'package:unittest/compact_vm_config.dart'; +import 'dart:io'; + +main(){ + + useCompactVMConfiguration(); + + test('max 80 chars per line',(){ + + Directory libs = new Directory("../lib"); + + List l = libs.listSync(recursive: true); + + l.forEach((FileSystemEntity i){ + if (i is File){ + List lines = i.readAsLinesSync(); + + int ln = 0; + + lines.forEach((String l){ + ln++; + expect(l.length, lessThan(80), reason:"To long line in file ${i.path} line ${ln}"); + }); + } + }); + }); + +} + \ No newline at end of file diff --git a/tests/unittests.dart b/tests/unittests.dart index f126372..442e73d 100644 --- a/tests/unittests.dart +++ b/tests/unittests.dart @@ -51,7 +51,7 @@ void main() { /// tests for JS Wrapper group('connection',(){ - //js_rtc.main(); + js_rtc.main(); }); diff --git a/tools/selftest.sh b/tools/selftest.sh new file mode 100755 index 0000000..9bc731f --- /dev/null +++ b/tools/selftest.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +dart --package-root="../packages" ../tests/selftest_test.dart \ No newline at end of file