Skip to content

Commit

Permalink
Add some (marked) failing tests for FILE_HEADER
Browse files Browse the repository at this point in the history
Bug: #33033
Change-Id: I89d358dd1dc41d8bece7f16ed49fb98b9b8c0aa5
Reviewed-on: https://dart-review.googlesource.com/55104
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Danny Tuppeny <dantup@google.com>
  • Loading branch information
DanTup authored and commit-bot@chromium.org committed May 16, 2018
1 parent 021b4a0 commit 9b87767
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions pkg/analysis_server/test/src/computer/folding_computer_test.dart
Expand Up @@ -35,6 +35,7 @@ main() {}
""";

// Since there are no region comment markers above
// just check the length instead of the contents
final regions = await _computeRegions(content);
expect(regions, hasLength(0));
}
Expand Down Expand Up @@ -195,6 +196,50 @@ class MyClass2 {/*4:INC*/
_compareRegions(regions, content);
}

@failingTest
test_file_header() async {
String content = """
// Copyright some year by some people/*1:EXC*/
// See LICENCE etc./*1:INC:FILE_HEADER*/
// This is not the file header
// It's just a comment
main() {}
""";

final regions = await _computeRegions(content);
_compareRegions(regions, content);
}

@failingTest
test_file_header_with_script_prefix() async {
String content = """
#! /usr/bin/dart
// Copyright some year by some people/*1:EXC*/
// See LICENCE etc./*1:INC:FILE_HEADER*/
// This is not the file header
// It's just a comment
main() {}
""";

final regions = await _computeRegions(content);
_compareRegions(regions, content);
}

test_comment_is_not_considered_file_header() async {
String content = """
// This is not the file header
// It's just a comment
main() {}
""";

// Since there are no region comment markers above
// just check the length instead of the contents
final regions = await _computeRegions(content);
expect(regions, hasLength(0));
}

/// Compares provided folding regions with expected
/// regions extracted from the comments in the provided content.
void _compareRegions(List<FoldingRegion> regions, String content) {
Expand Down

0 comments on commit 9b87767

Please sign in to comment.