|
| 1 | +// Copyright (c) 2026, the Dart project authors. Please see the AUTHORS file |
| 2 | +// for details. All rights reserved. Use of this source code is governed by a |
| 3 | +// BSD-style license that can be found in the LICENSE file. |
| 4 | + |
| 5 | +import 'package:record_use/src/location.dart'; |
| 6 | +import 'package:record_use/src/reference.dart'; |
| 7 | +import 'package:test/test.dart'; |
| 8 | + |
| 9 | +void main() { |
| 10 | + group('toString', () { |
| 11 | + test('Location', () { |
| 12 | + const location = Location(uri: 'package:foo/foo.dart'); |
| 13 | + expect(location.toString(), 'Location(uri: package:foo/foo.dart)'); |
| 14 | + }); |
| 15 | + |
| 16 | + test('CallWithArguments', () { |
| 17 | + const call = CallWithArguments( |
| 18 | + positionalArguments: [], |
| 19 | + namedArguments: {}, |
| 20 | + loadingUnit: 'dart.foo', |
| 21 | + location: Location(uri: 'package:foo/foo.dart'), |
| 22 | + ); |
| 23 | + expect( |
| 24 | + call.toString(), |
| 25 | + 'CallWithArguments(location: Location(uri: package:foo/foo.dart), loadingUnit: dart.foo)', |
| 26 | + ); |
| 27 | + }); |
| 28 | + |
| 29 | + test('CallWithArguments with multiple args', () { |
| 30 | + const call = CallWithArguments( |
| 31 | + positionalArguments: [null, null], |
| 32 | + namedArguments: {'bar': null, 'baz': null}, |
| 33 | + loadingUnit: 'dart.foo', |
| 34 | + location: Location(uri: 'package:foo/foo.dart'), |
| 35 | + ); |
| 36 | + expect( |
| 37 | + call.toString(), |
| 38 | + 'CallWithArguments(positional: null, null, named: bar=null, baz=null, location: Location(uri: package:foo/foo.dart), loadingUnit: dart.foo)', |
| 39 | + ); |
| 40 | + }); |
| 41 | + }); |
| 42 | +} |
0 commit comments