Skip to content
This repository has been archived by the owner on Aug 29, 2023. It is now read-only.

Commit

Permalink
Add test cases for comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaron D. Marasco committed Jun 14, 2020
1 parent eebabc8 commit 8ffd893
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
23 changes: 23 additions & 0 deletions flint/tests/Comments.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Test a few comment things

#ifdef X // This is valid
#endif

#ifdef Y /* This too */
#endif

// A single quote means it's a contraction or a possessive.
// It's not an unterminated string.
// Neither is "this.

// Apparently, you can have empty preprocessor lines. With the same exact text:
// Seen in boost/container/detail/minimal_char_traits_header.hpp:
# // A single quote means it's a contraction or a possessive.
# // It's not an unterminated string.
# // Neither is "this.

// Empty comment:
//
/**/
// Particularly nasty empty comment with no newline, just EOF:
//
4 changes: 2 additions & 2 deletions flint/tests/expected.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
[Error ] Throw.cpp:10: Heap-allocated exception: throw new (MyException)(); This is usually a mistake in c++.
[Error ] Throw.cpp:12: Heap-allocated exception: throw new MyException(); This is usually a mistake in c++.

Lint Summary: 14 files
Lint Summary: 15 files
Errors: 23 Warnings: 29 Advice: 1

Estimated Lines of Code: 306
Estimated Lines of Code: 330

0 comments on commit 8ffd893

Please sign in to comment.