diff --git a/tests/data/javascript.js b/tests/data/javascript.js new file mode 100644 index 000000000..4bccfa6a2 --- /dev/null +++ b/tests/data/javascript.js @@ -0,0 +1,33 @@ +// 33 lines, 14 code, 11 comments, 8 blanks + +/* + * /* Nested comment + * // single line comment + * */ + +/* + +function add(a, b) { + return a + b; +} +*/ + +class Rectangle { + constructor(width, height) { + this.width = width; + this.height = height; + } + + get area() { + return this.calcArea(); + } + + calcArea() { + return this.width * this.height; + } +} + +let rect = new Rectangle(20, 20); +console.log(rect.area); // 400 + +// Comment diff --git a/tests/data/typescript.ts b/tests/data/typescript.ts new file mode 100644 index 000000000..319f9dc71 --- /dev/null +++ b/tests/data/typescript.ts @@ -0,0 +1,33 @@ +// 33 lines, 19 code, 7 comments, 7 blanks +/* + + Multi-line comment with blanks + + + * + */ +// Comment +class Person { + #age: number; + #name: string; // end of line comment + #height: number; + + constructor(age: number, name: string, height: number) { + this.#age = age; + this.#name = name; + this.#height = height; + } +} + +let main = () => { + // Comment with quote " + let person = new Person( + 5, + `Phill + + the giant`, + 7 + ); +}; + +main();