use raw strings to avoid escaping (#50322)

This commit is contained in:
Alexandre Ardhuin
2020-02-07 16:35:55 +01:00
committed by GitHub
parent 8735ab1e35
commit b953c3e5a8
28 changed files with 171 additions and 157 deletions

View File

@@ -1819,7 +1819,7 @@ class StringProperty extends DiagnosticsProperty<String> {
// Escape linebreaks in multiline strings to avoid confusing output when
// the parent of this node is trying to display all properties on the same
// line.
text = text.replaceAll('\n', '\\n');
text = text.replaceAll('\n', r'\n');
}
if (quoted && text != null) {

View File

@@ -70,22 +70,22 @@ Future<void> main() async {
},
));
expect(console.join('\n'), matches(
'^══╡ EXCEPTION CAUGHT BY ERROR HANDLING TEST ╞═══════════════════════════════════════════════════════\n'
'The following assertion was thrown testing the error handling logic:\n'
'Message goes here\\.\n'
'\'[^\']+flutter/test/foundation/error_reporting_test\\.dart\':\n'
'Failed assertion: line [0-9]+ pos [0-9]+: \'false\'\n'
'\n'
'When the exception was thrown, this was the stack:\n'
'#0 getSampleStack\\.<anonymous closure> \\([^)]+flutter/test/foundation/error_reporting_test\\.dart:[0-9]+:[0-9]+\\)\n'
'#2 getSampleStack \\([^)]+flutter/test/foundation/error_reporting_test\\.dart:[0-9]+:[0-9]+\\)\n'
'#3 main \\([^)]+flutter/test/foundation/error_reporting_test\\.dart:[0-9]+:[0-9]+\\)\n'
'(.+\n)+' // TODO(ianh): when fixing #4021, also filter out frames from the test infrastructure below the first call to our main()
'\\(elided [0-9]+ frames from class _RawReceivePortImpl and dart:async\\)\n'
'\n'
'line 1 of extra information\n'
'line 2 of extra information\n'
'════════════════════════════════════════════════════════════════════════════════════════════════════\$',
r'^══╡ EXCEPTION CAUGHT BY ERROR HANDLING TEST ╞═══════════════════════════════════════════════════════\n'
r'The following assertion was thrown testing the error handling logic:\n'
r'Message goes here\.\n'
r"'[^']+flutter/test/foundation/error_reporting_test\.dart':\n"
r"Failed assertion: line [0-9]+ pos [0-9]+: 'false'\n"
r'\n'
r'When the exception was thrown, this was the stack:\n'
r'#0 getSampleStack\.<anonymous closure> \([^)]+flutter/test/foundation/error_reporting_test\.dart:[0-9]+:[0-9]+\)\n'
r'#2 getSampleStack \([^)]+flutter/test/foundation/error_reporting_test\.dart:[0-9]+:[0-9]+\)\n'
r'#3 main \([^)]+flutter/test/foundation/error_reporting_test\.dart:[0-9]+:[0-9]+\)\n'
r'(.+\n)+' // TODO(ianh): when fixing #4021, also filter out frames from the test infrastructure below the first call to our main()
r'\(elided [0-9]+ frames from class _RawReceivePortImpl and dart:async\)\n'
r'\n'
r'line 1 of extra information\n'
r'line 2 of extra information\n'
r'════════════════════════════════════════════════════════════════════════════════════════════════════$',
));
console.clear();
FlutterError.dumpErrorToConsole(FlutterErrorDetails(
@@ -102,16 +102,16 @@ Future<void> main() async {
exception: getAssertionErrorWithLongMessage(),
));
expect(console.join('\n'), matches(
'^══╡ EXCEPTION CAUGHT BY FLUTTER FRAMEWORK ╞═════════════════════════════════════════════════════════\n'
'The following assertion was thrown:\n'
'word word word word word word word word word word word word word word word word word word word word\n'
'word word word word word word word word word word word word word word word word word word word word\n'
'word word word word word word word word word word word word word word word word word word word word\n'
'word word word word word word word word word word word word word word word word word word word word\n'
'word word word word word word word word word word word word word word word word word word word word\n'
'\'[^\']+flutter/test/foundation/error_reporting_test\\.dart\':\n'
'Failed assertion: line [0-9]+ pos [0-9]+: \'false\'\n'
'════════════════════════════════════════════════════════════════════════════════════════════════════\$',
r'^══╡ EXCEPTION CAUGHT BY FLUTTER FRAMEWORK ╞═════════════════════════════════════════════════════════\n'
r'The following assertion was thrown:\n'
r'word word word word word word word word word word word word word word word word word word word word\n'
r'word word word word word word word word word word word word word word word word word word word word\n'
r'word word word word word word word word word word word word word word word word word word word word\n'
r'word word word word word word word word word word word word word word word word word word word word\n'
r'word word word word word word word word word word word word word word word word word word word word\n'
r"'[^']+flutter/test/foundation/error_reporting_test\.dart':\n"
r"Failed assertion: line [0-9]+ pos [0-9]+: 'false'\n"
r'════════════════════════════════════════════════════════════════════════════════════════════════════$',
));
console.clear();
FlutterError.dumpErrorToConsole(FlutterErrorDetails(
@@ -143,21 +143,21 @@ Future<void> main() async {
},
));
expect(console.join('\n'), matches(
'^══╡ EXCEPTION CAUGHT BY ERROR HANDLING TEST ╞═══════════════════════════════════════════════════════\n'
'The following assertion was thrown testing the error handling logic:\n'
'\'[^\']+flutter/test/foundation/error_reporting_test\\.dart\':[\n ]'
'Failed[\n ]assertion:[\n ]line[\n ][0-9]+[\n ]pos[\n ][0-9]+:[\n ]\'false\':[\n ]is[\n ]not[\n ]true\\.\n'
'\n'
'When the exception was thrown, this was the stack:\n'
'#0 getSampleStack\\.<anonymous closure> \\([^)]+flutter/test/foundation/error_reporting_test\\.dart:[0-9]+:[0-9]+\\)\n'
'#2 getSampleStack \\([^)]+flutter/test/foundation/error_reporting_test\\.dart:[0-9]+:[0-9]+\\)\n'
'#3 main \\([^)]+flutter/test/foundation/error_reporting_test\\.dart:[0-9]+:[0-9]+\\)\n'
'(.+\n)+' // TODO(ianh): when fixing #4021, also filter out frames from the test infrastructure below the first call to our main()
'\\(elided [0-9]+ frames from class _RawReceivePortImpl and dart:async\\)\n'
'\n'
'line 1 of extra information\n'
'line 2 of extra information\n'
'════════════════════════════════════════════════════════════════════════════════════════════════════\$',
r'^══╡ EXCEPTION CAUGHT BY ERROR HANDLING TEST ╞═══════════════════════════════════════════════════════\n'
r'The following assertion was thrown testing the error handling logic:\n'
r"'[^']+flutter/test/foundation/error_reporting_test\.dart':[\n ]"
r"Failed[\n ]assertion:[\n ]line[\n ][0-9]+[\n ]pos[\n ][0-9]+:[\n ]'false':[\n ]is[\n ]not[\n ]true\.\n"
r'\n'
r'When the exception was thrown, this was the stack:\n'
r'#0 getSampleStack\.<anonymous closure> \([^)]+flutter/test/foundation/error_reporting_test\.dart:[0-9]+:[0-9]+\)\n'
r'#2 getSampleStack \([^)]+flutter/test/foundation/error_reporting_test\.dart:[0-9]+:[0-9]+\)\n'
r'#3 main \([^)]+flutter/test/foundation/error_reporting_test\.dart:[0-9]+:[0-9]+\)\n'
r'(.+\n)+' // TODO(ianh): when fixing #4021, also filter out frames from the test infrastructure below the first call to our main()
r'\(elided [0-9]+ frames from class _RawReceivePortImpl and dart:async\)\n'
r'\n'
r'line 1 of extra information\n'
r'line 2 of extra information\n'
r'════════════════════════════════════════════════════════════════════════════════════════════════════$',
));
console.clear();
FlutterError.dumpErrorToConsole(FlutterErrorDetails(
@@ -175,11 +175,11 @@ Future<void> main() async {
exception: exception,
));
expect(console.join('\n'), matches(
'^══╡ EXCEPTION CAUGHT BY FLUTTER FRAMEWORK ╞═════════════════════════════════════════════════════════\n'
'The following NoSuchMethodError was thrown:\n'
'Receiver: 5\n'
'Tried calling: foo = 2, 4\n'
'════════════════════════════════════════════════════════════════════════════════════════════════════\$',
r'^══╡ EXCEPTION CAUGHT BY FLUTTER FRAMEWORK ╞═════════════════════════════════════════════════════════\n'
r'The following NoSuchMethodError was thrown:\n'
r'Receiver: 5\n'
r'Tried calling: foo = 2, 4\n'
r'════════════════════════════════════════════════════════════════════════════════════════════════════$',
));
console.clear();
FlutterError.dumpErrorToConsole(FlutterErrorDetails(
@@ -196,10 +196,10 @@ Future<void> main() async {
exception: 'hello',
));
expect(console.join('\n'), matches(
'^══╡ EXCEPTION CAUGHT BY FLUTTER FRAMEWORK ╞═════════════════════════════════════════════════════════\n'
'The following message was thrown:\n'
'hello\n'
'════════════════════════════════════════════════════════════════════════════════════════════════════\$',
r'^══╡ EXCEPTION CAUGHT BY FLUTTER FRAMEWORK ╞═════════════════════════════════════════════════════════\n'
r'The following message was thrown:\n'
r'hello\n'
r'════════════════════════════════════════════════════════════════════════════════════════════════════$',
));
console.clear();
FlutterError.dumpErrorToConsole(const FlutterErrorDetails(

View File

@@ -165,7 +165,7 @@ void main() {
final SemanticsTester semantics = SemanticsTester(tester);
await tester.pumpWidget(
const Text(
'\$\$',
r'$$',
semanticsLabel: 'Double dollars',
textDirection: TextDirection.ltr,
)
@@ -191,7 +191,7 @@ void main() {
await tester.pumpWidget(
const Directionality(
textDirection: TextDirection.ltr,
child: Text('\$\$', semanticsLabel: 'Double dollars')),
child: Text(r'$$', semanticsLabel: 'Double dollars')),
);
expect(

View File

@@ -212,17 +212,18 @@ class FlutterWebConnection {
}
try {
result = await waitFor<dynamic>(() => _driver.execute('r'
'eturn \$flutterDriverResult', <String>[]),
matcher: isNotNull,
timeout: duration ?? const Duration(days: 30));
result = await waitFor<dynamic>(
() => _driver.execute(r'return $flutterDriverResult', <String>[]),
matcher: isNotNull,
timeout: duration ?? const Duration(days: 30),
);
} catch (_) {
// Returns null if exception thrown.
return null;
} finally {
// Resets the result.
_driver.execute('''
\$flutterDriverResult = null
_driver.execute(r'''
$flutterDriverResult = null
''', <void>[]);
}
return result;
@@ -243,7 +244,7 @@ class FlutterWebConnection {
/// Waits until extension is installed.
Future<void> waitUntilExtensionInstalled(sync_io.WebDriver driver, Duration timeout) async {
await waitFor<void>(() =>
driver.execute('return typeof(window.\$flutterDriver)', <String>[]),
driver.execute(r'return typeof(window.$flutterDriver)', <String>[]),
matcher: 'function',
timeout: timeout ?? const Duration(days: 365));
}

View File

@@ -19,12 +19,12 @@ import 'dart:js_util' as js_util;
///
/// * [_extension_io.dart], which has the dart:io implementation
void registerWebServiceExtension(Future<Map<String, dynamic>> Function(Map<String, String>) call) {
js_util.setProperty(html.window, '\$flutterDriver', allowInterop((dynamic message) async {
js_util.setProperty(html.window, r'$flutterDriver', allowInterop((dynamic message) async {
// ignore: undefined_function, undefined_identifier
final Map<String, String> params = Map<String, String>.from(
jsonDecode(message as String) as Map<String, dynamic>);
final Map<String, dynamic> result = Map<String, dynamic>.from(
await call(params));
context['\$flutterDriverResult'] = json.encode(result);
context[r'$flutterDriverResult'] = json.encode(result);
}));
}

View File

@@ -20,7 +20,7 @@ void main() {
test('web_extension should register a function', () {
expect(() => registerWebServiceExtension(call),
returnsNormally);
expect(js.context.hasProperty('\$flutterDriver'), true);
expect(js.context.hasProperty(r'$flutterDriver'), true);
});
});
}

View File

@@ -114,7 +114,7 @@ class FileSystemUtils {
///
/// On Windows it replaces all '\' with '\\'. On other platforms, it returns the
/// path unchanged.
String escapePath(String path) => _platform.isWindows ? path.replaceAll('\\', '\\\\') : path;
String escapePath(String path) => _platform.isWindows ? path.replaceAll(r'\', r'\\') : path;
/// Returns true if the file system [entity] has not been modified since the
/// latest modification to [referenceFile].

View File

@@ -409,7 +409,7 @@ class IosProject extends FlutterProjectPlatform implements XcodeBasedProject {
} on FileNotFoundException {
// iOS tooling not found; likely not running OSX; let [fromPlist] be null
}
if (fromPlist != null && !fromPlist.contains('\$')) {
if (fromPlist != null && !fromPlist.contains(r'$')) {
// Info.plist has no build variables in product bundle ID.
return fromPlist;
}

View File

@@ -163,7 +163,7 @@ class VsCode {
if (localAppData != null) {
searchLocations.add(_VsCodeInstallLocation(
globals.fs.path.join(localAppData, 'Programs\\Microsoft VS Code'),
globals.fs.path.join(localAppData, r'Programs\Microsoft VS Code'),
'.vscode',
));
}
@@ -179,7 +179,7 @@ class VsCode {
));
if (localAppData != null) {
searchLocations.add(_VsCodeInstallLocation(
globals.fs.path.join(localAppData, 'Programs\\Microsoft VS Code Insiders'),
globals.fs.path.join(localAppData, r'Programs\Microsoft VS Code Insiders'),
'.vscode-insiders',
isInsiders: true,
));

View File

@@ -100,7 +100,7 @@ class ChromeDevice extends Device {
String version = 'unknown';
if (globals.platform.isWindows) {
final ProcessResult result = await globals.processManager.run(<String>[
r'reg', 'query', 'HKEY_CURRENT_USER\\Software\\Google\\Chrome\\BLBeacon', '/v', 'version',
r'reg', 'query', r'HKEY_CURRENT_USER\Software\Google\Chrome\BLBeacon', '/v', 'version',
]);
if (result.exitCode == 0) {
final List<String> parts = (result.stdout as String).split(RegExp(r'\s+'));

View File

@@ -37,7 +37,7 @@ void main() {
if (globals.platform.isWindows) {
flutterRootUri
..write('/')
..write(canonicalizedFlutterRootPath.replaceAll('\\', '/'));
..write(canonicalizedFlutterRootPath.replaceAll(r'\', '/'));
} else {
flutterRootUri.write(canonicalizedFlutterRootPath);
}

View File

@@ -40,15 +40,15 @@ void main() {
group('network errors', () {
testUsingContext('retries if gradle fails while downloading', () async {
const String errorMessage = '''
const String errorMessage = r'''
Exception in thread "main" java.io.FileNotFoundException: https://downloads.gradle.org/distributions/gradle-4.1.1-all.zip
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1872)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1474)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:254)
at org.gradle.wrapper.Download.downloadInternal(Download.java:58)
at org.gradle.wrapper.Download.download(Download.java:44)
at org.gradle.wrapper.Install\$1.call(Install.java:61)
at org.gradle.wrapper.Install\$1.call(Install.java:48)
at org.gradle.wrapper.Install$1.call(Install.java:61)
at org.gradle.wrapper.Install$1.call(Install.java:48)
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65)
at org.gradle.wrapper.Install.createDist(Install.java:48)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:128)
@@ -66,7 +66,7 @@ at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)''';
});
testUsingContext('retries if gradle fails downloading with proxy error', () async {
const String errorMessage = '''
const String errorMessage = r'''
Exception in thread "main" java.io.IOException: Unable to tunnel through proxy. Proxy returns "HTTP/1.1 400 Bad Request"
at sun.net.www.protocol.http.HttpURLConnection.doTunneling(HttpURLConnection.java:2124)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:183)
@@ -75,8 +75,8 @@ at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:254)
at org.gradle.wrapper.Download.downloadInternal(Download.java:58)
at org.gradle.wrapper.Download.download(Download.java:44)
at org.gradle.wrapper.Install\$1.call(Install.java:61)
at org.gradle.wrapper.Install\$1.call(Install.java:48)
at org.gradle.wrapper.Install$1.call(Install.java:61)
at org.gradle.wrapper.Install$1.call(Install.java:48)
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65)
at org.gradle.wrapper.Install.createDist(Install.java:48)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:128)
@@ -113,7 +113,7 @@ Exception in thread "main" java.lang.RuntimeException: Timeout of 120000 reached
});
testUsingContext('retries if remote host closes connection', () async {
const String errorMessage = '''
const String errorMessage = r'''
Downloading https://services.gradle.org/distributions/gradle-5.6.2-all.zip
Exception in thread "main" javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:994)
@@ -129,8 +129,8 @@ Exception in thread "main" javax.net.ssl.SSLHandshakeException: Remote host clos
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:263)
at org.gradle.wrapper.Download.downloadInternal(Download.java:58)
at org.gradle.wrapper.Download.download(Download.java:44)
at org.gradle.wrapper.Install\$1.call(Install.java:61)
at org.gradle.wrapper.Install\$1.call(Install.java:48)
at org.gradle.wrapper.Install$1.call(Install.java:61)
at org.gradle.wrapper.Install$1.call(Install.java:48)
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65)
at org.gradle.wrapper.Install.createDist(Install.java:48)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:128)
@@ -175,7 +175,7 @@ Exception in thread "main" java.io.FileNotFoundException: https://downloads.grad
});
testUsingContext('retries if the connection is reset', () async {
const String errorMessage = '''
const String errorMessage = r'''
Downloading https://services.gradle.org/distributions/gradle-5.6.2-all.zip
Exception in thread "main" java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(SocketInputStream.java:210)
@@ -194,8 +194,8 @@ Exception in thread "main" java.net.SocketException: Connection reset
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:263)
at org.gradle.wrapper.Download.downloadInternal(Download.java:58)
at org.gradle.wrapper.Download.download(Download.java:44)
at org.gradle.wrapper.Install\$1.call(Install.java:61)
at org.gradle.wrapper.Install\$1.call(Install.java:48)
at org.gradle.wrapper.Install$1.call(Install.java:61)
at org.gradle.wrapper.Install$1.call(Install.java:48)
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65)
at org.gradle.wrapper.Install.createDist(Install.java:48)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:128)

View File

@@ -457,7 +457,7 @@ void main() {
});
testUsingContext('create settings_aar.gradle when current settings.gradle loads plugins', () {
const String currentSettingsGradle = '''
const String currentSettingsGradle = r'''
include ':app'
def flutterProjectRoot = rootProject.projectDir.parentFile.toPath()
@@ -470,8 +470,8 @@ if (pluginsFile.exists()) {
plugins.each { name, path ->
def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile()
include ":\$name"
project(":\$name").projectDir = pluginDirectory
include ":$name"
project(":$name").projectDir = pluginDirectory
}
''';

View File

@@ -105,8 +105,8 @@ void main() {
fileSystem: fileSystem,
platform: FakePlatform(operatingSystem: 'windows'),
);
expect(fsUtils.escapePath('C:\\foo\\bar\\cool.dart'), 'C:\\\\foo\\\\bar\\\\cool.dart');
expect(fsUtils.escapePath('foo\\bar\\cool.dart'), 'foo\\\\bar\\\\cool.dart');
expect(fsUtils.escapePath(r'C:\foo\bar\cool.dart'), r'C:\\foo\\bar\\cool.dart');
expect(fsUtils.escapePath(r'foo\bar\cool.dart'), r'foo\\bar\\cool.dart');
expect(fsUtils.escapePath('C:/foo/bar/cool.dart'), 'C:/foo/bar/cool.dart');
});
@@ -118,7 +118,7 @@ void main() {
);
expect(fsUtils.escapePath('/foo/bar/cool.dart'), '/foo/bar/cool.dart');
expect(fsUtils.escapePath('foo/bar/cool.dart'), 'foo/bar/cool.dart');
expect(fsUtils.escapePath('foo\\cool.dart'), 'foo\\cool.dart');
expect(fsUtils.escapePath(r'foo\cool.dart'), r'foo\cool.dart');
});
});
}

View File

@@ -282,7 +282,7 @@ void main() {
);
logger.printStatus('Rude Interrupting Cow');
status.stop();
final String a = currentPlatform().isWindows ? '\\' : '⣽';
final String a = currentPlatform().isWindows ? r'\' : '⣽';
final String b = currentPlatform().isWindows ? '|' : '⣻';
expect(

View File

@@ -126,13 +126,13 @@ void main() {
await _recompile(streamController, generator, mockFrontendServerStdIn,
'result abc\nline1\nline2\nabc\nabc /path/to/main.dart.dill 0\n');
await _accept(streamController, generator, mockFrontendServerStdIn, '^accept\\n\$');
await _accept(streamController, generator, mockFrontendServerStdIn, r'^accept\n$');
await _recompile(streamController, generator, mockFrontendServerStdIn,
'result abc\nline1\nline2\nabc\nabc /path/to/main.dart.dill 0\n');
// No sources returned from reject command.
await _reject(streamController, generator, mockFrontendServerStdIn, 'result abc\nabc\n',
'^reject\\n\$');
r'^reject\n$');
verifyNoMoreInteractions(mockFrontendServerStdIn);
expect(mockFrontendServerStdIn.getAndClear(), isEmpty);
expect(testLogger.errorText, equals(
@@ -193,7 +193,7 @@ Future<void> _recompile(
);
expect(output.outputFilename, equals('/path/to/main.dart.dill'));
final String commands = mockFrontendServerStdIn.getAndClear();
final RegExp re = RegExp('^recompile (.*)\\n/path/to/main.dart\\n(.*)\\n\$');
final RegExp re = RegExp(r'^recompile (.*)\n/path/to/main.dart\n(.*)\n$');
expect(commands, matches(re));
final Match match = re.firstMatch(commands);
expect(match[1] == match[2], isTrue);

View File

@@ -388,7 +388,7 @@ apply plugin: 'kotlin-android'
});
}
);
when(mockPlistUtils.getValueFromFile(any, any)).thenReturn('\$(PRODUCT_BUNDLE_IDENTIFIER)');
when(mockPlistUtils.getValueFromFile(any, any)).thenReturn(r'$(PRODUCT_BUNDLE_IDENTIFIER)');
expect(await project.ios.productBundleIdentifier, 'io.flutter.someProject');
});
@@ -403,7 +403,7 @@ apply plugin: 'kotlin-android'
});
}
);
when(mockPlistUtils.getValueFromFile(any, any)).thenReturn('\$(PRODUCT_BUNDLE_IDENTIFIER).\$(SUFFIX)');
when(mockPlistUtils.getValueFromFile(any, any)).thenReturn(r'$(PRODUCT_BUNDLE_IDENTIFIER).$(SUFFIX)');
expect(await project.ios.productBundleIdentifier, 'io.flutter.someProject.suffix');
});
testWithMocks('empty surrounded by quotes', () async {

View File

@@ -117,7 +117,7 @@ void main() {
when(mockProcessManager.run(<String>[
'reg',
'query',
'HKEY_CURRENT_USER\\Software\\Google\\Chrome\\BLBeacon',
r'HKEY_CURRENT_USER\Software\Google\Chrome\BLBeacon',
'/v',
'version',
])).thenAnswer((Invocation invocation) async {

View File

@@ -196,7 +196,7 @@ class FuchsiaRemoteConnection {
sshConfigPath ??= Platform.environment['FUCHSIA_SSH_CONFIG'];
if (address == null) {
throw FuchsiaRemoteConnectionError(
'No address supplied, and \$FUCHSIA_DEVICE_URL not found.');
r'No address supplied, and $FUCHSIA_DEVICE_URL not found.');
}
const String interfaceDelimiter = '%';
if (address.contains(interfaceDelimiter)) {