anchor.diff:        ),
       });
   
  -    testUsingContext('run', () async {
  +    testUsingContext('run pass arguments through to pub', () async {
  +      Cache.flutterRoot = '';
  +      globals.fs.file('pubspec.yaml').createSync();
  +      final IOSink stdin = IOSink(StreamController<List<int>>().sink);
  +      processManager.addCommand(
  +        FakeCommand(command: const <String>[
  +          '/bin/cache/dart-sdk/bin/pub', 'run', '--foo', 'bar'],
  +          stdin: stdin,
  +        ),
  +      );
         await createTestCommandRunner(PackagesCommand()).run(<String>['packages', '--verbose', 'pub', 'run', '--foo', 'bar']);
  -      final List<String> commands = mockProcessManager.commands;
  -      expect(commands, hasLength(4));
  -      expect(commands[0], matches(r'dart-sdk[\\/]bin[\\/]pub'));
  -      expect(commands[1], 'run');
  -      expect(commands[2], '--foo');
  -      expect(commands[3], 'bar');
  -    }, overrides: <Type, Generator>{
  -      ProcessManager: () => mockProcessManager,
  +
  +      expect(processManager.hasRemainingExpectations, false);
  +    }, overrides: <Type, Generator>{
  +      FileSystem: () => MemoryFileSystem.test(),
  +      Platform: () => FakePlatform(operatingSystem: 'linux', environment: <String, String>{}),
  +      ProcessManager: () => processManager,
         Stdio: () => mockStdio,
  -      Pub: () => Pub(
  -        fileSystem: globals.fs,
  -        logger: globals.logger,
  -        processManager: globals.processManager,
  -        usage: globals.flutterUsage,
  -        botDetector: globals.botDetector,
  -        platform: globals.platform,
  -      ),
  -    });
  -
  -    testUsingContext('pub publish', () async {
  -      final PromptingProcess process = PromptingProcess();
  -      mockProcessManager.processFactory = (List<String> commands) => process;
  -      final Future<void> runPackages = createTestCommandRunner(PackagesCommand()).run(<String>['pub', 'publish']);
  -      final Future<void> runPrompt = process.showPrompt('Proceed (y/n)? ', <String>['hello', 'world']);
  -      final Future<void> simulateUserInput = Future<void>(() {
  -        mockStdio.simulateStdin('y');
  -      });
  -      await Future.wait<void>(<Future<void>>[runPackages, runPrompt, simulateUserInput]);
  -      final List<String> commands = mockProcessManager.commands;
  -      expect(commands, hasLength(2));
  -      expect(commands[0], matches(r'dart-sdk[\\/]bin[\\/]pub'));
  -      expect(commands[1], 'publish');
  -      final List<String> stdout = mockStdio.writtenToStdout;
  -      expect(stdout, hasLength(4));
  -      expect(stdout.sublist(0, 2), contains('Proceed (y/n)? '));
  -      expect(stdout.sublist(0, 2), contains('y\n'));
  -      expect(stdout[2], 'hello\n');
  -      expect(stdout[3], 'world\n');
  -    }, overrides: <Type, Generator>{
  -      ProcessManager: () => mockProcessManager,
  -      Stdio: () => mockStdio,
  -      Pub: () => Pub(
  -        fileSystem: globals.fs,
  -        logger: globals.logger,
  -        processManager: globals.processManager,
  -        usage: globals.flutterUsage,
  -        botDetector: globals.botDetector,
  -        platform: globals.platform,
  -      ),
  -    });
  -
  -    testUsingContext('pub publish input fails', () async {
  -      final PromptingProcess process = PromptingProcess(stdinError: true);
  -      mockProcessManager.processFactory = (List<String> commands) => process;
  -      final Future<void> runPackages = createTestCommandRunner(PackagesCommand()).run(<String>['pub', 'publish']);
  -      final Future<void> runPrompt = process.showPrompt('Proceed (y/n)? ', <String>['hello', 'world']);
  -      final Future<void> simulateUserInput = Future<void>(() {
  -        mockStdio.simulateStdin('y');
  -      });
  -      await Future.wait<void>(<Future<void>>[runPackages, runPrompt, simulateUserInput]);
  -      final List<String> commands = mockProcessManager.commands;
  -      expect(commands, hasLength(2));
  -      expect(commands[0], matches(r'dart-sdk[\\/]bin[\\/]pub'));
  -      expect(commands[1], 'publish');
  -      // We get a trace message about the write to stdin failing.
  -      expect(testLogger.traceText, contains('Echoing stdin to the pub subprocess failed'));
  -    }, overrides: <Type, Generator>{
  -      ProcessManager: () => mockProcessManager,
  -      Stdio: () => mockStdio,
  -      Pub: () => Pub(
  -        fileSystem: globals.fs,
  -        logger: globals.logger,
  -        processManager: globals.processManager,
  -        usage: globals.flutterUsage,
  -        botDetector: globals.botDetector,
  -        platform: globals.platform,
  -      ),
  -    });
  -
  -    testUsingContext('publish', () async {
  -      await createTestCommandRunner(PackagesCommand()).run(<String>['pub', 'publish']);
  -      final List<String> commands = mockProcessManager.commands;
  -      expect(commands, hasLength(2));
  -      expect(commands[0], matches(r'dart-sdk[\\/]bin[\\/]pub'));
  -      expect(commands[1], 'publish');
  -    }, overrides: <Type, Generator>{
  -      ProcessManager: () => mockProcessManager,
  -      Stdio: () => mockStdio,
  -      BotDetector: () => const FakeBotDetector(true),
  -      Pub: () => Pub(
  -        fileSystem: globals.fs,
  -        logger: globals.logger,
  -        processManager: globals.processManager,
  -        usage: globals.flutterUsage,
  -        botDetector: globals.botDetector,
  -        platform: globals.platform,
  -      ),
  -    });
  -
  -    testUsingContext('packages publish', () async {
  -      await createTestCommandRunner(PackagesCommand()).run(<String>['packages', 'pub', 'publish']);
  -      final List<String> commands = mockProcessManager.commands;
  -      expect(commands, hasLength(2));
  -      expect(commands[0], matches(r'dart-sdk[\\/]bin[\\/]pub'));
  -      expect(commands[1], 'publish');
  -    }, overrides: <Type, Generator>{
  -      ProcessManager: () => mockProcessManager,
  -      Stdio: () => mockStdio,
  -      BotDetector: () => const FakeBotDetector(true),
  -      Pub: () => Pub(
  -        fileSystem: globals.fs,
  -        logger: globals.logger,
  -        processManager: globals.processManager,
  -        usage: globals.flutterUsage,
  -        botDetector: globals.botDetector,
  -        platform: globals.platform,
  -      ),
  -    });
  -
  -    testUsingContext('deps', () async {
  -      await createTestCommandRunner(PackagesCommand()).run(<String>['packages', 'deps']);
  -      final List<String> commands = mockProcessManager.commands;
  -      expect(commands, hasLength(2));
  -      expect(commands[0], matches(r'dart-sdk[\\/]bin[\\/]pub'));
  -      expect(commands[1], 'deps');
  -    }, overrides: <Type, Generator>{
  -      ProcessManager: () => mockProcessManager,
  -      Stdio: () => mockStdio,
  -      BotDetector: () => const FakeBotDetector(true),
  -      Pub: () => Pub(
  -        fileSystem: globals.fs,
  -        logger: globals.logger,
  -        processManager: globals.processManager,
  -        usage: globals.flutterUsage,
  -        botDetector: globals.botDetector,
  -        platform: globals.platform,
  -      ),
  -    });
  -
  -    testUsingContext('cache', () async {
  -      await createTestCommandRunner(PackagesCommand()).run(<String>['packages', 'cache']);
  -      final List<String> commands = mockProcessManager.commands;
  -      expect(commands, hasLength(2));
  -      expect(commands[0], matches(r'dart-sdk[\\/]bin[\\/]pub'));
  -      expect(commands[1], 'cache');
  -    }, overrides: <Type, Generator>{
  -      ProcessManager: () => mockProcessManager,
  -      Stdio: () => mockStdio,
  -      BotDetector: () => const FakeBotDetector(true),
  -      Pub: () => Pub(
  -        fileSystem: globals.fs,
  -        logger: globals.logger,
  -        processManager: globals.processManager,
  -        usage: globals.flutterUsage,
  -        botDetector: globals.botDetector,
  -        platform: globals.platform,
  -      ),
  -    });
  -
  -    testUsingContext('version', () async {
  -      await createTestCommandRunner(PackagesCommand()).run(<String>['packages', 'version']);
  -      final List<String> commands = mockProcessManager.commands;
  -      expect(commands, hasLength(2));
  -      expect(commands[0], matches(r'dart-sdk[\\/]bin[\\/]pub'));
  -      expect(commands[1], 'version');
  -    }, overrides: <Type, Generator>{
  -      ProcessManager: () => mockProcessManager,
  -      Stdio: () => mockStdio,
  -      BotDetector: () => const FakeBotDetector(true),
  -      Pub: () => Pub(
  -        fileSystem: globals.fs,
  -        logger: globals.logger,
  -        processManager: globals.processManager,
  -        usage: globals.flutterUsage,
  -        botDetector: globals.botDetector,
  -        platform: globals.platform,
  -      ),
  -    });
  -
  -    testUsingContext('uploader', () async {
  -      await createTestCommandRunner(PackagesCommand()).run(<String>['packages', 'uploader']);
  -      final List<String> commands = mockProcessManager.commands;
  -      expect(commands, hasLength(2));
  -      expect(commands[0], matches(r'dart-sdk[\\/]bin[\\/]pub'));
  -      expect(commands[1], 'uploader');
  -    }, overrides: <Type, Generator>{
  -      ProcessManager: () => mockProcessManager,
  -      Stdio: () => mockStdio,
  -      BotDetector: () => const FakeBotDetector(true),
  -      Pub: () => Pub(
  -        fileSystem: globals.fs,
  -        logger: globals.logger,
  -        processManager: globals.processManager,
  -        usage: globals.flutterUsage,
  -        botDetector: globals.botDetector,
  -        platform: globals.platform,
  -      ),
  -    });
  -
  -    testUsingContext('global', () async {
  -      await createTestCommandRunner(PackagesCommand()).run(<String>['packages', 'global', 'list']);
  -      final List<String> commands = mockProcessManager.commands;
  -      expect(commands, hasLength(3));
  -      expect(commands[0], matches(r'dart-sdk[\\/]bin[\\/]pub'));
  -      expect(commands[1], 'global');
  -      expect(commands[2], 'list');
  -    }, overrides: <Type, Generator>{
  -      ProcessManager: () => mockProcessManager,
  -      Stdio: () => mockStdio,
  -      BotDetector: () => const FakeBotDetector(true),
  -      Pub: () => Pub(
  -        fileSystem: globals.fs,
  -        logger: globals.logger,
  -        processManager: globals.processManager,
  -        usage: globals.flutterUsage,
  -        botDetector: globals.botDetector,
  -        platform: globals.platform,
  -      ),
  -    });
  -
  -    testUsingContext('outdated', () async {
  -      await createTestCommandRunner(PackagesCommand()).run(<String>['packages', 'outdated']);
  -      final List<String> commands = mockProcessManager.commands;
  -      expect(commands, hasLength(2));
  -      expect(commands[0], matches(r'dart-sdk[\\/]bin[\\/]pub'));
  -      expect(commands[1], 'outdated');
  -    }, overrides: <Type, Generator>{
  -      ProcessManager: () => mockProcessManager,
  -      Stdio: () => mockStdio,
  -      BotDetector: () => const FakeBotDetector(true),
         Pub: () => Pub(
           fileSystem: globals.fs,
           logger: globals.logger,
  
positive.code: 
  // @dart = 2.8
  
  import 'dart:convert';
  
  import 'package:args/command_runner.dart';
  import 'package:flutter_tools/src/base/bot_detector.dart';
  import 'package:flutter_tools/src/base/error_handling_io.dart';
  import 'package:flutter_tools/src/base/file_system.dart' hide IOSink;
  import 'package:flutter_tools/src/base/io.dart';
  import 'package:flutter_tools/src/cache.dart';
  import 'package:flutter_tools/src/commands/packages.dart';
  import 'package:flutter_tools/src/dart/pub.dart';
  
negative.code: import '../../src/common.dart';
  import '../../src/context.dart';
  import '../../src/fakes.dart';
  import '../../src/testbed.dart';
  
  void main() {
  