ScrabbleScoreTest.php 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * Calculate the value of scrabble score for a given word.
  5. */
  6. class ScrabbleScoreTest extends PHPUnit\Framework\TestCase
  7. {
  8. public static function setUpBeforeClass(): void
  9. {
  10. require_once 'ScrabbleScore.php';
  11. }
  12. /**
  13. * uuid f46cda29-1ca5-4ef2-bd45-388a767e3db2
  14. * @testdox Lowercase letter
  15. */
  16. public function testLowercaseSingleLetter(): void
  17. {
  18. $word = 'a';
  19. $this->assertEquals(1, score($word));
  20. }
  21. /**
  22. * uuid f7794b49-f13e-45d1-a933-4e48459b2201
  23. * @testdox Uppercase letter
  24. */
  25. public function testUppercaseSingleLetter(): void
  26. {
  27. $word = 'A';
  28. $this->assertEquals(1, score($word));
  29. }
  30. /**
  31. * uuid eaba9c76-f9fa-49c9-a1b0-d1ba3a5b31fa
  32. * @testdox Valuable letter
  33. */
  34. public function testValuableSingleLetter(): void
  35. {
  36. $word = 'f';
  37. $this->assertEquals(4, score($word));
  38. }
  39. /**
  40. * uuid f3c8c94e-bb48-4da2-b09f-e832e103151e
  41. * @testdox Short word
  42. */
  43. public function testShortWord(): void
  44. {
  45. $word = 'at';
  46. $this->assertEquals(2, score($word));
  47. }
  48. /**
  49. * uuid 71e3d8fa-900d-4548-930e-68e7067c4615
  50. * @testdox Short, valuable word
  51. */
  52. public function testShortValuableWord(): void
  53. {
  54. $word = 'zoo';
  55. $this->assertEquals(12, score($word));
  56. }
  57. /**
  58. * uuid d3088ad9-570c-4b51-8764-c75d5a430e99
  59. * @testdox Medium word
  60. */
  61. public function testMediumWord(): void
  62. {
  63. $word = 'street';
  64. $this->assertEquals(6, score($word));
  65. }
  66. /**
  67. * uuid fa20c572-ad86-400a-8511-64512daac352
  68. * @testdox Medium, valuable word
  69. */
  70. public function testMediumValuableWord(): void
  71. {
  72. $word = 'quirky';
  73. $this->assertEquals(22, score($word));
  74. }
  75. /**
  76. * uuid 9336f0ba-9c2b-4fa0-bd1c-2e2d328cf967
  77. * @testdox Long, mixed-case word
  78. */
  79. public function testLongMixedCaseWord(): void
  80. {
  81. $word = 'OxyphenButazone';
  82. $this->assertEquals(41, score($word));
  83. }
  84. /**
  85. * uuid 1e34e2c3-e444-4ea7-b598-3c2b46fd2c10
  86. * @testdox English-like word
  87. */
  88. public function testEnglishLikeWord(): void
  89. {
  90. $word = 'pinata';
  91. $this->assertEquals(8, score($word));
  92. }
  93. /**
  94. * uuid 4efe3169-b3b6-4334-8bae-ff4ef24a7e4f
  95. * @testdox Empty input
  96. */
  97. public function testEmptyWordScore(): void
  98. {
  99. $word = '';
  100. $this->assertEquals(0, score($word));
  101. }
  102. /*
  103. * uuid 3b305c1c-f260-4e15-a5b5-cb7d3ea7c3d7
  104. * @testdox Entire alphabet available
  105. */
  106. public function testEntireAlphabetWord(): void
  107. {
  108. $word = 'abcdefghijklmnopqrstuvwxyz';
  109. $this->assertEquals(87, score($word));
  110. }
  111. }
PANIC: session(release): write data/sessions/1/e/1e72e1f1f58cac00: no space left on device

PANIC

session(release): write data/sessions/1/e/1e72e1f1f58cac00: no space left on device
/my/cache/.heroku/go/go-path/pkg/mod/github.com/go-macaron/session@v1.0.3/session.go:204 (0xb13e07)
/my/cache/.heroku/go/go-path/pkg/mod/gopkg.in/macaron.v1@v1.5.1/context.go:80 (0x967b75)
/my/cache/.heroku/go/go-path/pkg/mod/github.com/go-macaron/inject@v0.0.0-20200308113650-138e5925c53b/inject.go:157 (0x9512ee)
/my/cache/.heroku/go/go-path/pkg/mod/github.com/go-macaron/inject@v0.0.0-20200308113650-138e5925c53b/inject.go:135 (0x951205)
/my/cache/.heroku/go/go-path/pkg/mod/gopkg.in/macaron.v1@v1.5.1/context.go:124 (0x967cc4)
/my/cache/.heroku/go/go-path/pkg/mod/gopkg.in/macaron.v1@v1.5.1/context.go:114 (0x967bf6)
/my/cache/.heroku/go/go-path/pkg/mod/gopkg.in/macaron.v1@v1.5.1/recovery.go:161 (0x15baec4)
/my/cache/.heroku/go/go-path/pkg/mod/gopkg.in/macaron.v1@v1.5.1/logger.go:40 (0x96b257)
/my/cache/.heroku/go/go-path/pkg/mod/github.com/go-macaron/inject@v0.0.0-20200308113650-138e5925c53b/inject.go:157 (0x9512ee)
/my/cache/.heroku/go/go-path/pkg/mod/github.com/go-macaron/inject@v0.0.0-20200308113650-138e5925c53b/inject.go:135 (0x951205)
/my/cache/.heroku/go/go-path/pkg/mod/gopkg.in/macaron.v1@v1.5.1/context.go:124 (0x967cc4)
/my/cache/.heroku/go/go-path/pkg/mod/gopkg.in/macaron.v1@v1.5.1/router.go:187 (0x972959)
/my/cache/.heroku/go/go-path/pkg/mod/gopkg.in/macaron.v1@v1.5.1/router.go:304 (0x973a01)
/my/cache/.heroku/go/go-path/pkg/mod/gopkg.in/macaron.v1@v1.5.1/macaron.go:218 (0x96c572)
/my/cache/.heroku/go/go1.26.3/go/src/net/http/server.go:3311 (0x85a5cd)
/my/cache/.heroku/go/go1.26.3/go/src/net/http/server.go:2073 (0x837f6f)
/my/cache/.heroku/go/go1.26.3/go/src/runtime/asm_amd64.s:1771 (0x493380)