Reverse the sense of the terms snippet and sample. (#48254)
This commit is contained in:
committed by
Flutter GitHub Bot
parent
dbed575c01
commit
fabf4e3d0d
@@ -32,22 +32,22 @@ void main() {
|
||||
matches(RegExp(r'[/\\]flutter sdk[/\\]dev[/\\]snippets[/\\]config[/\\]templates')));
|
||||
});
|
||||
test('html skeleton file for sample is correct', () async {
|
||||
expect(
|
||||
config.getHtmlSkeletonFile(SnippetType.snippet).path,
|
||||
matches(RegExp(
|
||||
r'[/\\]flutter sdk[/\\]dev[/\\]snippets[/\\]config[/\\]skeletons[/\\]snippet.html')));
|
||||
});
|
||||
test('html skeleton file for app with no dartpad is correct', () async {
|
||||
expect(
|
||||
config.getHtmlSkeletonFile(SnippetType.sample).path,
|
||||
matches(RegExp(
|
||||
r'[/\\]flutter sdk[/\\]dev[/\\]snippets[/\\]config[/\\]skeletons[/\\]sample.html')));
|
||||
});
|
||||
test('html skeleton file for app with no dartpad is correct', () async {
|
||||
expect(
|
||||
config.getHtmlSkeletonFile(SnippetType.application).path,
|
||||
matches(RegExp(
|
||||
r'[/\\]flutter sdk[/\\]dev[/\\]snippets[/\\]config[/\\]skeletons[/\\]application.html')));
|
||||
});
|
||||
test('html skeleton file for app with dartpad is correct', () async {
|
||||
expect(
|
||||
config.getHtmlSkeletonFile(SnippetType.application, showDartPad: true).path,
|
||||
config.getHtmlSkeletonFile(SnippetType.sample, showDartPad: true).path,
|
||||
matches(RegExp(
|
||||
r'[/\\]flutter sdk[/\\]dev[/\\]snippets[/\\]config[/\\]skeletons[/\\]dartpad-application.html')));
|
||||
r'[/\\]flutter sdk[/\\]dev[/\\]snippets[/\\]config[/\\]skeletons[/\\]dartpad-sample.html')));
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -37,20 +37,20 @@ main() {
|
||||
{{code}}
|
||||
}
|
||||
''');
|
||||
configuration.getHtmlSkeletonFile(SnippetType.application).writeAsStringSync('''
|
||||
configuration.getHtmlSkeletonFile(SnippetType.sample).writeAsStringSync('''
|
||||
<div>HTML Bits</div>
|
||||
{{description}}
|
||||
<pre>{{code}}</pre>
|
||||
<pre>{{app}}</pre>
|
||||
<div>More HTML Bits</div>
|
||||
''');
|
||||
configuration.getHtmlSkeletonFile(SnippetType.sample).writeAsStringSync('''
|
||||
configuration.getHtmlSkeletonFile(SnippetType.snippet).writeAsStringSync('''
|
||||
<div>HTML Bits</div>
|
||||
{{description}}
|
||||
<pre>{{code}}</pre>
|
||||
<div>More HTML Bits</div>
|
||||
''');
|
||||
configuration.getHtmlSkeletonFile(SnippetType.application, showDartPad: true).writeAsStringSync('''
|
||||
configuration.getHtmlSkeletonFile(SnippetType.sample, showDartPad: true).writeAsStringSync('''
|
||||
<div>HTML Bits (DartPad-style)</div>
|
||||
<iframe class="snippet-dartpad" src="https://dartpad.dev/embed-flutter.html?split=60&run=true&sample_id={{id}}"></iframe>
|
||||
<div>More HTML Bits</div>
|
||||
@@ -83,7 +83,7 @@ void main() {
|
||||
|
||||
final String html = generator.generate(
|
||||
inputFile,
|
||||
SnippetType.application,
|
||||
SnippetType.sample,
|
||||
template: 'template',
|
||||
metadata: <String, Object>{
|
||||
'id': 'id',
|
||||
@@ -126,7 +126,7 @@ void main() {
|
||||
|
||||
final String html = generator.generate(
|
||||
inputFile,
|
||||
SnippetType.sample,
|
||||
SnippetType.snippet,
|
||||
metadata: <String, Object>{'id': 'id'},
|
||||
);
|
||||
expect(html, contains('<div>HTML Bits</div>'));
|
||||
@@ -155,7 +155,7 @@ void main() {
|
||||
|
||||
final String html = generator.generate(
|
||||
inputFile,
|
||||
SnippetType.application,
|
||||
SnippetType.sample,
|
||||
showDartPad: true,
|
||||
template: 'template',
|
||||
metadata: <String, Object>{'id': 'id'},
|
||||
@@ -185,7 +185,7 @@ void main() {
|
||||
|
||||
generator.generate(
|
||||
inputFile,
|
||||
SnippetType.application,
|
||||
SnippetType.sample,
|
||||
template: 'template',
|
||||
output: outputFile,
|
||||
metadata: <String, Object>{'sourcePath': 'some/path.dart', 'id': 'id'},
|
||||
|
||||
Reference in New Issue
Block a user