Created
July 22, 2021 18:33
-
-
Save henryhamon/8a1d927b63d779e8cdc6febf1d1fca73 to your computer and use it in GitHub Desktop.
CodeGolf MagicTowel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Class CodeGolf.MagicTowel | |
{ | |
ClassMethod AddWater(pill As %Integer) As %Integer | |
{ | |
Quit "" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// test case | |
Class CodeGolf.Test.MagicTowel Extends %UnitTest.TestCase | |
{ | |
Method TestUsingHardCoded() | |
{ | |
Do $$$AssertEquals(##class(CodeGolf.MagicTowel).AddWater(123), 122333) | |
Do $$$AssertEquals(##class(CodeGolf.MagicTowel).AddWater(341), 33344441) | |
Do $$$AssertEquals(##class(CodeGolf.MagicTowel).AddWater(124381), 1224444333888888881) | |
} | |
Method TestUsingZeros() | |
{ | |
Do $$$AssertEquals(##class(CodeGolf.MagicTowel).AddWater(0), "") | |
Do $$$AssertEquals(##class(CodeGolf.MagicTowel).AddWater("0000"), "") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment