From 4368327139c26e428b4e182b1eb4c032d86ff61f Mon Sep 17 00:00:00 2001 From: Sahil Kumar Date: Fri, 26 Feb 2021 18:52:29 +0530 Subject: [PATCH] [LLC] Remove unwanted testing code Signed-off-by: Sahil Kumar --- packages/stream_chat/test/version_test.dart | 119 ++------------------ 1 file changed, 10 insertions(+), 109 deletions(-) diff --git a/packages/stream_chat/test/version_test.dart b/packages/stream_chat/test/version_test.dart index f5b2a2c0..55b1818a 100644 --- a/packages/stream_chat/test/version_test.dart +++ b/packages/stream_chat/test/version_test.dart @@ -11,113 +11,14 @@ void prepareTest() { } } -// void main() { -// prepareTest(); -// test('stream chat version matches pubspec', () { -// final String pubspecPath = '${Directory.current.path}/pubspec.yaml'; -// final String pubspec = File(pubspecPath).readAsStringSync(); -// final RegExp regex = RegExp('version:\s*(.*)'); -// final RegExpMatch match = regex.firstMatch(pubspec); -// expect(match, isNotNull); -// expect(PACKAGE_VERSION, match.group(1).trim()); -// }); -// } - -void main() async { - var items = [ - ABC('Sahil', 22, 62.0), - ABC('Devraj', 23, 76.0), - ABC('Harsh', 18, 48.0), - ABC('Harsh', 17, 88.0), - ABC('Harsh', 17, 48.0), - ABC('Devraj', 23, 74.0, { - 'Test': 'Sahil', - }), - ABC('Devraj', 12, 76.0, { - 'Test': 'Avni', - }), - ]; - - var comparators = [ - (ABC a, ABC b) { - // if (a.extraData == null) return -1; - // if (b.extraData == null) return 1; - // if (a.extraData == null && b.extraData == null) return 0; - var aa = (a.extraData ?? {})['Test'] as String; - var bb = (b.extraData ?? {})['Test'] as String; - return aa.compareTo(bb); - }, - // (ABC a, ABC b) => a.name.compareTo(b.name), - // (ABC a, ABC b) => a.age.compareTo(b.age), - // (ABC a, ABC b) => a.weight.compareTo(b.weight), - ]; - - // for (var comp in comparators.reversed) { - // items.sort(comp); - // } - - // items.sort(comparators[last]) - - Stream getLaugh2() { - if (true) { - return Stream.value('HEHO'); - } else { - return getLaugh2(); - } - } - - Stream getLaugh() async* { - yield 'HAHA'; - await Future.delayed(const Duration(seconds: 3)); - yield 'HOHO'; - await Future.delayed(const Duration(seconds: 3)); - yield 'HEHE'; - } - - // final stream = BehaviorSubject.seeded('HAHA'); - // - // stream.('HOHO'); - - await for (var value in getLaugh2()) { - print(value); - } - - // stream.add('HEHE'); - - // compare(ABC a, ABC b) { - // int result; - // for (final comparator in comparators) { - // try { - // result = comparator(a, b); - // } catch (e) { - // result = 0; - // } - // if (result != 0) return result; - // } - // return 0; - // } - // - // items.sort(compare); - // - // print(items); -} - -class ABC { - final String name; - final int age; - final double weight; - final Map extraData; - - const ABC(this.name, this.age, this.weight, [this.extraData]); - - @override - String toString() { - return ''' - \n - Name : $name, - Age : $age, - Weight : $weight, - ExtraData : $extraData, - '''; - } +void main() { + prepareTest(); + test('stream chat version matches pubspec', () { + final String pubspecPath = '${Directory.current.path}/pubspec.yaml'; + final String pubspec = File(pubspecPath).readAsStringSync(); + final RegExp regex = RegExp('version:\s*(.*)'); + final RegExpMatch match = regex.firstMatch(pubspec); + expect(match, isNotNull); + expect(PACKAGE_VERSION, match.group(1).trim()); + }); }