From 854d4b6f2b67ea7f45e487879f4bbd65bec6be4e Mon Sep 17 00:00:00 2001 From: KhotKeys Date: Sun, 26 Jul 2026 22:26:47 +0100 Subject: [PATCH 01/10] Implement getAngleType function --- .../implement/1-get-angle-type.js | 28 +++++++++---------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/Sprint-3/1-implement-and-rewrite-tests/implement/1-get-angle-type.js b/Sprint-3/1-implement-and-rewrite-tests/implement/1-get-angle-type.js index 9e05a871e2..fb98a2f799 100644 --- a/Sprint-3/1-implement-and-rewrite-tests/implement/1-get-angle-type.js +++ b/Sprint-3/1-implement-and-rewrite-tests/implement/1-get-angle-type.js @@ -8,22 +8,17 @@ // - "Reflex angle" for angles greater than 180° and less than 360° // - "Invalid angle" for angles outside the valid range. -// Assumption: The parameter is a valid number. (You do not need to handle non-numeric inputs.) - -// Acceptance criteria: -// After you have implemented the function, write tests to cover all the cases, and -// execute the code to ensure all tests pass. - function getAngleType(angle) { - // TODO: Implement this function + if (angle <= 0 || angle >= 360) return "Invalid angle"; + if (angle === 90) return "Right angle"; + if (angle === 180) return "Straight angle"; + if (angle < 90) return "Acute angle"; + if (angle < 180) return "Obtuse angle"; + return "Reflex angle"; } -// The line below allows us to load the getAngleType function into tests in other files. -// This will be useful in the "rewrite tests with jest" step. module.exports = getAngleType; -// This helper function is written to make our assertions easier to read. -// If the actual output matches the target output, the test will pass function assertEquals(actualOutput, targetOutput) { console.assert( actualOutput === targetOutput, @@ -31,7 +26,10 @@ function assertEquals(actualOutput, targetOutput) { ); } -// TODO: Write tests to cover all cases, including boundary and invalid cases. -// Example: Identify Right Angles -const right = getAngleType(90); -assertEquals(right, "Right angle"); +assertEquals(getAngleType(90), "Right angle"); +assertEquals(getAngleType(45), "Acute angle"); +assertEquals(getAngleType(135), "Obtuse angle"); +assertEquals(getAngleType(180), "Straight angle"); +assertEquals(getAngleType(270), "Reflex angle"); +assertEquals(getAngleType(0), "Invalid angle"); +assertEquals(getAngleType(360), "Invalid angle"); From bf179422eb801beff83e830820a9a552db034f9e Mon Sep 17 00:00:00 2001 From: KhotKeys Date: Sun, 26 Jul 2026 22:27:16 +0100 Subject: [PATCH 02/10] Implement isProperFraction function --- .../implement/2-is-proper-fraction.js | 23 ++++++------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/Sprint-3/1-implement-and-rewrite-tests/implement/2-is-proper-fraction.js b/Sprint-3/1-implement-and-rewrite-tests/implement/2-is-proper-fraction.js index 970cb9b641..d3cc3818b2 100644 --- a/Sprint-3/1-implement-and-rewrite-tests/implement/2-is-proper-fraction.js +++ b/Sprint-3/1-implement-and-rewrite-tests/implement/2-is-proper-fraction.js @@ -2,23 +2,13 @@ // when given two numbers, a numerator and a denominator, it should return true if // the given numbers form a proper fraction, and false otherwise. -// Assumption: The parameters are valid numbers (not NaN or Infinity). - -// Note: If you are unfamiliar with proper fractions, please look up its mathematical definition. - -// Acceptance criteria: -// After you have implemented the function, write tests to cover all the cases, and -// execute the code to ensure all tests pass. - function isProperFraction(numerator, denominator) { - // TODO: Implement this function + if (denominator === 0) return false; + return Math.abs(numerator) < Math.abs(denominator); } -// The line below allows us to load the isProperFraction function into tests in other files. -// This will be useful in the "rewrite tests with jest" step. module.exports = isProperFraction; -// Here's our helper again function assertEquals(actualOutput, targetOutput) { console.assert( actualOutput === targetOutput, @@ -26,8 +16,9 @@ function assertEquals(actualOutput, targetOutput) { ); } -// TODO: Write tests to cover all cases. -// What combinations of numerators and denominators should you test? - -// Example: 1/2 is a proper fraction assertEquals(isProperFraction(1, 2), true); +assertEquals(isProperFraction(2, 1), false); +assertEquals(isProperFraction(3, 3), false); +assertEquals(isProperFraction(-1, 2), true); +assertEquals(isProperFraction(1, -2), true); +assertEquals(isProperFraction(1, 0), false); From b59a9334315e0c7cba93235b66af656503748566 Mon Sep 17 00:00:00 2001 From: KhotKeys Date: Sun, 26 Jul 2026 22:27:45 +0100 Subject: [PATCH 03/10] Implement getCardValue function --- .../implement/3-get-card-value.js | 53 +++++++------------ 1 file changed, 19 insertions(+), 34 deletions(-) diff --git a/Sprint-3/1-implement-and-rewrite-tests/implement/3-get-card-value.js b/Sprint-3/1-implement-and-rewrite-tests/implement/3-get-card-value.js index ff5c532e1d..c8ed228688 100644 --- a/Sprint-3/1-implement-and-rewrite-tests/implement/3-get-card-value.js +++ b/Sprint-3/1-implement-and-rewrite-tests/implement/3-get-card-value.js @@ -1,35 +1,22 @@ -// This problem involves playing cards: https://en.wikipedia.org/wiki/Standard_52-card_deck - // Implement a function getCardValue, when given a string representing a playing card, // should return the numerical value of the card. -// A valid card string will contain a rank followed by the suit. -// The rank can be one of the following strings: -// "A", "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K" -// The suit can be one of the following emojis: -// "♠", "♥", "♦", "♣" -// For example: "A♠", "2♥", "10♥", "J♣", "Q♦", "K♦". - -// When the card is an ace ("A"), the function should return 11. -// When the card is a face card ("J", "Q", "K"), the function should return 10. -// When the card is a number card ("2" to "10"), the function should return its numeric value. - -// When the card string is invalid (not following the above format), the function should -// throw an error. - -// Acceptance criteria: -// After you have implemented the function, write tests to cover all the cases, and -// execute the code to ensure all tests pass. - function getCardValue(card) { - // TODO: Implement this function + const suit = card.slice(-1); + const rank = card.slice(0, -1); + const validSuits = ["\u2660", "\u2665", "\u2666", "\u2663"]; + const validRanks = ["A", "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K"]; + + if (!validSuits.includes(suit) || !validRanks.includes(rank)) { + throw new Error(`Invalid card: ${card}`); + } + if (rank === "A") return 11; + if (["J", "Q", "K"].includes(rank)) return 10; + return Number(rank); } -// The line below allows us to load the getCardValue function into tests in other files. -// This will be useful in the "rewrite tests with jest" step. module.exports = getCardValue; -// Helper functions to make our assertions easier to read. function assertEquals(actualOutput, targetOutput) { console.assert( actualOutput === targetOutput, @@ -37,18 +24,16 @@ function assertEquals(actualOutput, targetOutput) { ); } -// TODO: Write tests to cover all outcomes, including throwing errors for invalid cards. -// Examples: -assertEquals(getCardValue("9♠"), 9); +assertEquals(getCardValue("9\u2660"), 9); +assertEquals(getCardValue("A\u2660"), 11); +assertEquals(getCardValue("10\u2665"), 10); +assertEquals(getCardValue("J\u2663"), 10); +assertEquals(getCardValue("Q\u2666"), 10); +assertEquals(getCardValue("K\u2666"), 10); -// Handling invalid cards try { getCardValue("invalid"); - - // This line will not be reached if an error is thrown as expected - console.error("Error was not thrown for invalid card 😢"); + console.error("Error was not thrown for invalid card"); } catch (e) { - console.log("Error thrown for invalid card 🎉"); + console.log("Error thrown for invalid card"); } - -// What other invalid card cases can you think of? From 2f1b2469cc4b358e1af70738bfb43844283c8cc5 Mon Sep 17 00:00:00 2001 From: KhotKeys Date: Sun, 26 Jul 2026 22:28:17 +0100 Subject: [PATCH 04/10] Add Jest tests for getAngleType --- .../1-get-angle-type.test.js | 37 +++++++++++++------ 1 file changed, 25 insertions(+), 12 deletions(-) diff --git a/Sprint-3/1-implement-and-rewrite-tests/rewrite-tests-with-jest/1-get-angle-type.test.js b/Sprint-3/1-implement-and-rewrite-tests/rewrite-tests-with-jest/1-get-angle-type.test.js index d777f348d3..0c0f16710b 100644 --- a/Sprint-3/1-implement-and-rewrite-tests/rewrite-tests-with-jest/1-get-angle-type.test.js +++ b/Sprint-3/1-implement-and-rewrite-tests/rewrite-tests-with-jest/1-get-angle-type.test.js @@ -1,20 +1,33 @@ -// This statement loads the getAngleType function you wrote in the implement directory. -// We will use the same function, but write tests for it using Jest in this file. const getAngleType = require("../implement/1-get-angle-type"); -// TODO: Write tests in Jest syntax to cover all cases/outcomes, -// including boundary and invalid cases. - -// Case 1: Acute angles test(`should return "Acute angle" when (0 < angle < 90)`, () => { - // Test various acute angles, including boundary cases expect(getAngleType(1)).toEqual("Acute angle"); expect(getAngleType(45)).toEqual("Acute angle"); expect(getAngleType(89)).toEqual("Acute angle"); }); -// Case 2: Right angle -// Case 3: Obtuse angles -// Case 4: Straight angle -// Case 5: Reflex angles -// Case 6: Invalid angles +test(`should return "Right angle" for exactly 90`, () => { + expect(getAngleType(90)).toEqual("Right angle"); +}); + +test(`should return "Obtuse angle" when (90 < angle < 180)`, () => { + expect(getAngleType(91)).toEqual("Obtuse angle"); + expect(getAngleType(135)).toEqual("Obtuse angle"); + expect(getAngleType(179)).toEqual("Obtuse angle"); +}); + +test(`should return "Straight angle" for exactly 180`, () => { + expect(getAngleType(180)).toEqual("Straight angle"); +}); + +test(`should return "Reflex angle" when (180 < angle < 360)`, () => { + expect(getAngleType(181)).toEqual("Reflex angle"); + expect(getAngleType(270)).toEqual("Reflex angle"); + expect(getAngleType(359)).toEqual("Reflex angle"); +}); + +test(`should return "Invalid angle" for angles outside 0-360`, () => { + expect(getAngleType(0)).toEqual("Invalid angle"); + expect(getAngleType(360)).toEqual("Invalid angle"); + expect(getAngleType(-10)).toEqual("Invalid angle"); +}); From ec03f5502a259106c787761a8145df6430f4b170 Mon Sep 17 00:00:00 2001 From: KhotKeys Date: Sun, 26 Jul 2026 22:28:42 +0100 Subject: [PATCH 05/10] Add Jest tests for isProperFraction --- .../2-is-proper-fraction.test.js | 25 +++++++++++++++---- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/Sprint-3/1-implement-and-rewrite-tests/rewrite-tests-with-jest/2-is-proper-fraction.test.js b/Sprint-3/1-implement-and-rewrite-tests/rewrite-tests-with-jest/2-is-proper-fraction.test.js index 7f087b2ba1..da51b242a4 100644 --- a/Sprint-3/1-implement-and-rewrite-tests/rewrite-tests-with-jest/2-is-proper-fraction.test.js +++ b/Sprint-3/1-implement-and-rewrite-tests/rewrite-tests-with-jest/2-is-proper-fraction.test.js @@ -1,10 +1,25 @@ -// This statement loads the isProperFraction function you wrote in the implement directory. -// We will use the same function, but write tests for it using Jest in this file. const isProperFraction = require("../implement/2-is-proper-fraction"); -// TODO: Write tests in Jest syntax to cover all combinations of positives, negatives, zeros, and other categories. - -// Special case: numerator is zero test(`should return false when denominator is zero`, () => { expect(isProperFraction(1, 0)).toEqual(false); }); + +test(`should return true when numerator < denominator (positive)`, () => { + expect(isProperFraction(1, 2)).toEqual(true); + expect(isProperFraction(3, 7)).toEqual(true); +}); + +test(`should return false when numerator >= denominator`, () => { + expect(isProperFraction(2, 1)).toEqual(false); + expect(isProperFraction(3, 3)).toEqual(false); +}); + +test(`should handle negative numerator`, () => { + expect(isProperFraction(-1, 2)).toEqual(true); + expect(isProperFraction(-3, 2)).toEqual(false); +}); + +test(`should handle negative denominator`, () => { + expect(isProperFraction(1, -2)).toEqual(true); + expect(isProperFraction(3, -2)).toEqual(false); +}); From 25c18e0b6cee869ffc1b578adc0ca17f73bc2c1b Mon Sep 17 00:00:00 2001 From: KhotKeys Date: Sun, 26 Jul 2026 22:29:06 +0100 Subject: [PATCH 06/10] Add Jest tests for getCardValue --- .../3-get-card-value.test.js | 29 ++++++++++--------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/Sprint-3/1-implement-and-rewrite-tests/rewrite-tests-with-jest/3-get-card-value.test.js b/Sprint-3/1-implement-and-rewrite-tests/rewrite-tests-with-jest/3-get-card-value.test.js index cf7f9dae2e..451af1fd78 100644 --- a/Sprint-3/1-implement-and-rewrite-tests/rewrite-tests-with-jest/3-get-card-value.test.js +++ b/Sprint-3/1-implement-and-rewrite-tests/rewrite-tests-with-jest/3-get-card-value.test.js @@ -1,20 +1,23 @@ -// This statement loads the getCardValue function you wrote in the implement directory. -// We will use the same function, but write tests for it using Jest in this file. const getCardValue = require("../implement/3-get-card-value"); -// TODO: Write tests in Jest syntax to cover all possible outcomes. - -// Case 1: Ace (A) test(`Should return 11 when given an ace card`, () => { - expect(getCardValue("A♠")).toEqual(11); + expect(getCardValue("A\u2660")).toEqual(11); + expect(getCardValue("A\u2665")).toEqual(11); }); -// Suggestion: Group the remaining test data into these categories: -// Number Cards (2-10) -// Face Cards (J, Q, K) -// Invalid Cards +test(`Should return numeric value for number cards 2-10`, () => { + expect(getCardValue("2\u2665")).toEqual(2); + expect(getCardValue("5\u2666")).toEqual(5); + expect(getCardValue("10\u2665")).toEqual(10); +}); -// To learn how to test whether a function throws an error as expected in Jest, -// please refer to the Jest documentation: -// https://jestjs.io/docs/expect#tothrowerror +test(`Should return 10 for face cards J, Q, K`, () => { + expect(getCardValue("J\u2663")).toEqual(10); + expect(getCardValue("Q\u2666")).toEqual(10); + expect(getCardValue("K\u2660")).toEqual(10); +}); +test(`Should throw an error for invalid cards`, () => { + expect(() => getCardValue("invalid")).toThrow(); + expect(() => getCardValue("")).toThrow(); +}); From e3142d0705b9bb752a2bf4a88685991c17db460e Mon Sep 17 00:00:00 2001 From: KhotKeys Date: Wed, 29 Jul 2026 00:35:04 +0100 Subject: [PATCH 07/10] Implement isProperFraction and rewrite tests with clearer descriptions --- .../2-is-proper-fraction.js | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 Sprint-3/1-implement-and-rewrite-tests/2-is-proper-fraction.js diff --git a/Sprint-3/1-implement-and-rewrite-tests/2-is-proper-fraction.js b/Sprint-3/1-implement-and-rewrite-tests/2-is-proper-fraction.js new file mode 100644 index 0000000000..c5f0bb0da3 --- /dev/null +++ b/Sprint-3/1-implement-and-rewrite-tests/2-is-proper-fraction.js @@ -0,0 +1,36 @@ +// Implement a function isProperFraction, +// when given two numbers, a numerator and a denominator, it should return true if +// the given numbers form a proper fraction, and false otherwise. + +// Assumption: The parameters are valid numbers (not NaN or Infinity). + +// Note: If you are unfamiliar with proper fractions, please look up its mathematical definition. + +// Acceptance criteria: +// After you have implemented the function, write tests to cover all the cases, and +// execute the code to ensure all tests pass. + +function isProperFraction(numerator, denominator) { + if (denominator === 0) return false; + return Math.abs(numerator) < Math.abs(denominator); +} + +// The line below allows us to load the isProperFraction function into tests in other files. +// This will be useful in the "rewrite tests with jest" step. +module.exports = isProperFraction; + +// Here's our helper again +function assertEquals(actualOutput, targetOutput) { + console.assert( + actualOutput === targetOutput, + `Expected ${actualOutput} to equal ${targetOutput}` + ); +} + +// Tests covering all cases +assertEquals(isProperFraction(1, 2), true); +assertEquals(isProperFraction(2, 1), false); // numerator > denominator +assertEquals(isProperFraction(3, 3), false); // equal -> not proper +assertEquals(isProperFraction(-1, 2), true); // negative numerator +assertEquals(isProperFraction(1, -2), true); // negative denominator +assertEquals(isProperFraction(1, 0), false); // zero denominator From c2ffa8c001b0c19d8c0800d59ac3fb03b71072aa Mon Sep 17 00:00:00 2001 From: KhotKeys Date: Wed, 29 Jul 2026 00:40:28 +0100 Subject: [PATCH 08/10] Move isProperFraction code to correct files and remove stray copy --- .../2-is-proper-fraction.js | 36 ------------------- 1 file changed, 36 deletions(-) delete mode 100644 Sprint-3/1-implement-and-rewrite-tests/2-is-proper-fraction.js diff --git a/Sprint-3/1-implement-and-rewrite-tests/2-is-proper-fraction.js b/Sprint-3/1-implement-and-rewrite-tests/2-is-proper-fraction.js deleted file mode 100644 index c5f0bb0da3..0000000000 --- a/Sprint-3/1-implement-and-rewrite-tests/2-is-proper-fraction.js +++ /dev/null @@ -1,36 +0,0 @@ -// Implement a function isProperFraction, -// when given two numbers, a numerator and a denominator, it should return true if -// the given numbers form a proper fraction, and false otherwise. - -// Assumption: The parameters are valid numbers (not NaN or Infinity). - -// Note: If you are unfamiliar with proper fractions, please look up its mathematical definition. - -// Acceptance criteria: -// After you have implemented the function, write tests to cover all the cases, and -// execute the code to ensure all tests pass. - -function isProperFraction(numerator, denominator) { - if (denominator === 0) return false; - return Math.abs(numerator) < Math.abs(denominator); -} - -// The line below allows us to load the isProperFraction function into tests in other files. -// This will be useful in the "rewrite tests with jest" step. -module.exports = isProperFraction; - -// Here's our helper again -function assertEquals(actualOutput, targetOutput) { - console.assert( - actualOutput === targetOutput, - `Expected ${actualOutput} to equal ${targetOutput}` - ); -} - -// Tests covering all cases -assertEquals(isProperFraction(1, 2), true); -assertEquals(isProperFraction(2, 1), false); // numerator > denominator -assertEquals(isProperFraction(3, 3), false); // equal -> not proper -assertEquals(isProperFraction(-1, 2), true); // negative numerator -assertEquals(isProperFraction(1, -2), true); // negative denominator -assertEquals(isProperFraction(1, 0), false); // zero denominator From 2b983d6959c2b7154548180da5d3e06d1650afc4 Mon Sep 17 00:00:00 2001 From: KhotKeys Date: Wed, 29 Jul 2026 00:49:42 +0100 Subject: [PATCH 09/10] Use |...| notation in fraction test descriptions per review --- .../2-is-proper-fraction.test.js | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/Sprint-3/1-implement-and-rewrite-tests/rewrite-tests-with-jest/2-is-proper-fraction.test.js b/Sprint-3/1-implement-and-rewrite-tests/rewrite-tests-with-jest/2-is-proper-fraction.test.js index da51b242a4..c360dfb570 100644 --- a/Sprint-3/1-implement-and-rewrite-tests/rewrite-tests-with-jest/2-is-proper-fraction.test.js +++ b/Sprint-3/1-implement-and-rewrite-tests/rewrite-tests-with-jest/2-is-proper-fraction.test.js @@ -1,25 +1,24 @@ +// This statement loads the isProperFraction function you wrote in the implement directory. const isProperFraction = require("../implement/2-is-proper-fraction"); -test(`should return false when denominator is zero`, () => { - expect(isProperFraction(1, 0)).toEqual(false); -}); - -test(`should return true when numerator < denominator (positive)`, () => { +test(`should return true when |numerator| < |denominator|`, () => { expect(isProperFraction(1, 2)).toEqual(true); - expect(isProperFraction(3, 7)).toEqual(true); + expect(isProperFraction(-1, 2)).toEqual(true); + expect(isProperFraction(1, -2)).toEqual(true); + expect(isProperFraction(-1, -2)).toEqual(true); }); -test(`should return false when numerator >= denominator`, () => { +test(`should return false when |numerator| >= |denominator|`, () => { expect(isProperFraction(2, 1)).toEqual(false); expect(isProperFraction(3, 3)).toEqual(false); }); -test(`should handle negative numerator`, () => { +test(`should return true when |numerator| < |denominator| (negative numerator)`, () => { expect(isProperFraction(-1, 2)).toEqual(true); expect(isProperFraction(-3, 2)).toEqual(false); }); -test(`should handle negative denominator`, () => { +test(`should return true when |numerator| < |denominator| (negative denominator)`, () => { expect(isProperFraction(1, -2)).toEqual(true); expect(isProperFraction(3, -2)).toEqual(false); -}); +}); \ No newline at end of file From 29b0f47de8f9d8327232e1e5b0348b2f89999415 Mon Sep 17 00:00:00 2001 From: KhotKeys Date: Wed, 29 Jul 2026 00:54:20 +0100 Subject: [PATCH 10/10] Use literal suit characters per review --- .../implement/3-get-card-value.js | 22 +++++++------------ 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/Sprint-3/1-implement-and-rewrite-tests/implement/3-get-card-value.js b/Sprint-3/1-implement-and-rewrite-tests/implement/3-get-card-value.js index c8ed228688..6c040ee3ad 100644 --- a/Sprint-3/1-implement-and-rewrite-tests/implement/3-get-card-value.js +++ b/Sprint-3/1-implement-and-rewrite-tests/implement/3-get-card-value.js @@ -1,12 +1,10 @@ // Implement a function getCardValue, when given a string representing a playing card, // should return the numerical value of the card. - function getCardValue(card) { const suit = card.slice(-1); const rank = card.slice(0, -1); - const validSuits = ["\u2660", "\u2665", "\u2666", "\u2663"]; + const validSuits = ["♠", "♥", "♦", "♣"]; const validRanks = ["A", "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K"]; - if (!validSuits.includes(suit) || !validRanks.includes(rank)) { throw new Error(`Invalid card: ${card}`); } @@ -14,26 +12,22 @@ function getCardValue(card) { if (["J", "Q", "K"].includes(rank)) return 10; return Number(rank); } - module.exports = getCardValue; - function assertEquals(actualOutput, targetOutput) { console.assert( actualOutput === targetOutput, `Expected ${actualOutput} to equal ${targetOutput}` ); } - -assertEquals(getCardValue("9\u2660"), 9); -assertEquals(getCardValue("A\u2660"), 11); -assertEquals(getCardValue("10\u2665"), 10); -assertEquals(getCardValue("J\u2663"), 10); -assertEquals(getCardValue("Q\u2666"), 10); -assertEquals(getCardValue("K\u2666"), 10); - +assertEquals(getCardValue("9♠"), 9); +assertEquals(getCardValue("A♠"), 11); +assertEquals(getCardValue("10♥"), 10); +assertEquals(getCardValue("J♣"), 10); +assertEquals(getCardValue("Q♦"), 10); +assertEquals(getCardValue("K♦"), 10); try { getCardValue("invalid"); console.error("Error was not thrown for invalid card"); } catch (e) { console.log("Error thrown for invalid card"); -} +} \ No newline at end of file