• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

nogipx / rpc_dart / 15788067207

20 Jun 2025 09:08PM UTC coverage: 68.718% (-7.4%) from 76.097%
15788067207

push

github

nogipx
improve tests

2524 of 3673 relevant lines covered (68.72%)

5.52 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

88.89
/lib/src/primitives/string.dart
1
// SPDX-FileCopyrightText: 2025 Karim "nogipx" Mamatkazin <nogipx@gmail.com>
2
//
3
// SPDX-License-Identifier: LGPL-3.0-or-later
4

5
part of '_index.dart';
6

7
/// Обертка для строкового значения
8
class RpcString extends RpcPrimitiveMessage<String> {
9
  const RpcString(super.value);
37✔
10

11
  /// Создает RpcString из JSON
12
  factory RpcString.fromJson(Map<String, dynamic> json) {
8✔
13
    try {
14
      final v = json['v'];
8✔
15
      if (v == null) return const RpcString('');
16
      if (v is String) return RpcString(v);
16✔
17
      return RpcString(v.toString());
×
18
    } catch (e) {
19
      return const RpcString('');
20
    }
21
  }
22

23
  static RpcCodec<RpcString> get codec =>
3✔
24
      RpcCodec<RpcString>(RpcString.fromJson);
3✔
25

26
  @override
7✔
27
  String toString() => value;
7✔
28
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc