Skip to content
Permalink
Browse files

Added tests for C and SQL (#353)

  • Loading branch information...
maxcohn authored and XAMPPRocky committed Aug 5, 2019
1 parent baa2a65 commit ca5c141d4b03a42fe53b6a6e6dab27af8f5e3dc4
Showing with 53 additions and 0 deletions.
  1. +41 −0 tests/data/c.c
  2. +12 −0 tests/data/sql.sql
@@ -0,0 +1,41 @@
// 41 lines 28 code 5 comments 8 blanks

/* /* we can't nest block comments in c, but we can start one */
int main(void) {
char *start = "/*";

int x = 1;
x += 2; // end of line comment */
}

void foo() {
char *esc = "\"/*escaped quotes in a string and block commment*/\"";
func1();
func2();
char *next_line =
"*/ /*string on new line\
continued to another line\
bar();\
*/";

char *next_line2 = "line1\
// not a real comment\
line3*/";

/* Block comment
// line comment in a block comment
end block comment*/

char *late_start = // "
"wow\
thats pretty neat";

char *late_start2 = /* " */
"*/ still just a string"; // but this is a line comment
}

void foobar() {
int a = 4; // /*
int b = 5;
int c = 6; // */
}
@@ -0,0 +1,12 @@
-- 12 lines 4 code 5 comments 3 blanks


SELECT * FROM Users
WHERE FirstName is not null; -- select rows where the user has a first name

/* this is the beginning of a block comment
insert a new user into the Users table
-- line comment in a block comment
*/
INSERT INTO Users (FirstName, LastName)
VALUES ("John", "Does");

0 comments on commit ca5c141

Please sign in to comment.
You can’t perform that action at this time.