This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Copyright 2014 The Broken Licenses, Inc. All rights reserved.
|
||||
Use of this source code is governed by a BSD-style license that can be
|
||||
found in the LICENSE file. -->
|
||||
|
||||
<resources>
|
||||
</resources>
|
||||
@@ -0,0 +1,6 @@
|
||||
<!-- Copyright 2014 The Flutter Authors. All rights reserved.
|
||||
Use of this source code is governed by a BSD-style license that can be
|
||||
found in the LICENSE file. -->
|
||||
|
||||
<resources>
|
||||
</resources>
|
||||
@@ -120,18 +120,34 @@ void main() {
|
||||
|
||||
test('analyze.dart - verifyNoMissingLicense', () async {
|
||||
final String result = await capture(() => verifyNoMissingLicense(testRootPath, checkMinimums: false), exitCode: 1);
|
||||
final String lines = 'test/analyze-test-input/root/packages/foo/foo.dart'
|
||||
final String dartFile = 'test/analyze-test-input/root/packages/foo/foo.dart'
|
||||
.replaceAll('/', Platform.isWindows ? r'\' : '/');
|
||||
final String xmlFile = 'test/analyze-test-input/root/packages/foo/license.xml'
|
||||
.replaceAll('/', Platform.isWindows ? r'\' : '/');
|
||||
expect(result,
|
||||
'━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n'
|
||||
'The following 1 file does not have the right license header:\n'
|
||||
'$lines\n'
|
||||
'The following file does not have the right license header for dart files:\n'
|
||||
' $dartFile\n'
|
||||
'The expected license header is:\n'
|
||||
'// Copyright 2014 The Flutter Authors. All rights reserved.\n'
|
||||
'// Use of this source code is governed by a BSD-style license that can be\n'
|
||||
'// found in the LICENSE file.\n'
|
||||
'...followed by a blank line.\n'
|
||||
'━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n'
|
||||
'━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n'
|
||||
'The following file does not have the right license header for xml files:\n'
|
||||
' $xmlFile\n'
|
||||
'The expected license header is:\n'
|
||||
'A header matching the regular expression "(<\\?xml version="1.0" encoding="utf-8"\\?>\\n)?",\n'
|
||||
'followed by the following license text:\n'
|
||||
'<!-- Copyright 2014 The Flutter Authors. All rights reserved.\n'
|
||||
'Use of this source code is governed by a BSD-style license that can be\n'
|
||||
'found in the LICENSE file. -->\n'
|
||||
'...followed by a blank line.\n'
|
||||
'━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n'
|
||||
'━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n'
|
||||
'License check failed.\n'
|
||||
'━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n'
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user