trackler 2.1.0.29 → 2.1.0.30
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/common/exercises/twelve-days/description.md +1 -1
- data/lib/trackler/version.rb +1 -1
- data/tracks/delphi/SETUP.md +1 -1
- data/tracks/ecmascript/Makefile +4 -3
- data/tracks/ecmascript/config.json +0 -65
- data/tracks/ecmascript/exercises/accumulate/package.json +6 -0
- data/tracks/ecmascript/exercises/acronym/package.json +6 -0
- data/tracks/ecmascript/exercises/all-your-base/package.json +6 -0
- data/tracks/ecmascript/exercises/allergies/package.json +6 -0
- data/tracks/ecmascript/exercises/anagram/package.json +6 -0
- data/tracks/ecmascript/exercises/atbash-cipher/package.json +6 -0
- data/tracks/ecmascript/exercises/beer-song/package.json +6 -0
- data/tracks/ecmascript/exercises/binary-search-tree/package.json +6 -0
- data/tracks/ecmascript/exercises/binary-search/package.json +6 -0
- data/tracks/ecmascript/exercises/binary/package.json +6 -0
- data/tracks/ecmascript/exercises/bob/package.json +6 -0
- data/tracks/ecmascript/exercises/bracket-push/package.json +6 -0
- data/tracks/ecmascript/exercises/circular-buffer/circular-buffer.spec.js +11 -13
- data/tracks/ecmascript/exercises/circular-buffer/example.js +15 -14
- data/tracks/ecmascript/exercises/circular-buffer/package.json +6 -0
- data/tracks/ecmascript/exercises/clock/package.json +6 -0
- data/tracks/ecmascript/exercises/connect/package.json +6 -0
- data/tracks/ecmascript/exercises/crypto-square/package.json +6 -0
- data/tracks/ecmascript/exercises/custom-set/package.json +6 -0
- data/tracks/ecmascript/exercises/diamond/package.json +6 -0
- data/tracks/ecmascript/exercises/difference-of-squares/package.json +6 -0
- data/tracks/ecmascript/exercises/etl/package.json +6 -0
- data/tracks/ecmascript/exercises/food-chain/package.json +6 -0
- data/tracks/ecmascript/exercises/gigasecond/package.json +6 -0
- data/tracks/ecmascript/exercises/grade-school/package.json +6 -0
- data/tracks/ecmascript/exercises/grains/package.json +6 -0
- data/tracks/ecmascript/exercises/hamming/package.json +6 -0
- data/tracks/ecmascript/exercises/hello-world/package.json +6 -0
- data/tracks/ecmascript/exercises/hexadecimal/package.json +6 -0
- data/tracks/ecmascript/exercises/isogram/package.json +6 -0
- data/tracks/ecmascript/exercises/kindergarten-garden/package.json +6 -0
- data/tracks/ecmascript/exercises/largest-series-product/package.json +6 -0
- data/tracks/ecmascript/exercises/leap/package.json +6 -0
- data/tracks/ecmascript/exercises/linked-list/package.json +6 -0
- data/tracks/ecmascript/exercises/luhn/package.json +6 -0
- data/tracks/ecmascript/exercises/matrix/package.json +6 -0
- data/tracks/ecmascript/exercises/meetup/package.json +6 -0
- data/tracks/ecmascript/exercises/nth-prime/package.json +6 -0
- data/tracks/ecmascript/exercises/ocr-numbers/package.json +6 -0
- data/tracks/ecmascript/exercises/octal/package.json +6 -0
- data/tracks/ecmascript/exercises/package.json +11 -0
- data/tracks/ecmascript/exercises/palindrome-products/package.json +6 -0
- data/tracks/ecmascript/exercises/pangram/package.json +6 -0
- data/tracks/ecmascript/exercises/pascals-triangle/package.json +6 -0
- data/tracks/ecmascript/exercises/perfect-numbers/package.json +6 -0
- data/tracks/ecmascript/exercises/phone-number/package.json +6 -0
- data/tracks/ecmascript/exercises/pig-latin/package.json +6 -0
- data/tracks/ecmascript/exercises/prime-factors/package.json +6 -0
- data/tracks/ecmascript/exercises/pythagorean-triplet/package.json +6 -0
- data/tracks/ecmascript/exercises/queen-attack/package.json +6 -0
- data/tracks/ecmascript/exercises/raindrops/package.json +6 -0
- data/tracks/ecmascript/exercises/rna-transcription/package.json +6 -0
- data/tracks/ecmascript/exercises/robot-name/package.json +6 -0
- data/tracks/ecmascript/exercises/robot-simulator/package.json +6 -0
- data/tracks/ecmascript/exercises/roman-numerals/package.json +6 -0
- data/tracks/ecmascript/exercises/saddle-points/package.json +6 -0
- data/tracks/ecmascript/exercises/say/package.json +6 -0
- data/tracks/ecmascript/exercises/scrabble-score/package.json +6 -0
- data/tracks/ecmascript/exercises/secret-handshake/package.json +6 -0
- data/tracks/ecmascript/exercises/series/package.json +6 -0
- data/tracks/ecmascript/exercises/sieve/package.json +6 -0
- data/tracks/ecmascript/exercises/simple-cipher/package.json +6 -0
- data/tracks/ecmascript/exercises/space-age/package.json +6 -0
- data/tracks/ecmascript/exercises/strain/package.json +6 -0
- data/tracks/ecmascript/exercises/sum-of-multiples/package.json +6 -0
- data/tracks/ecmascript/exercises/triangle/package.json +6 -0
- data/tracks/ecmascript/exercises/trinary/package.json +6 -0
- data/tracks/ecmascript/exercises/two-bucket/package.json +6 -0
- data/tracks/ecmascript/exercises/word-count/package.json +6 -0
- data/tracks/ecmascript/exercises/wordy/package.json +6 -0
- data/tracks/ecmascript/package.json +6 -0
- data/tracks/ecmascript/yarn.lock +9 -2
- data/tracks/go/README.md +3 -4
- data/tracks/haskell/README.md +1 -1
- data/tracks/java/.gitignore +0 -1
- data/tracks/java/.travis.yml +15 -1
- data/tracks/java/bin/journey-test.sh +3 -4
- data/tracks/java/bin/unit-tests.sh +2 -2
- data/tracks/java/gradle/wrapper/gradle-wrapper.jar +0 -0
- data/tracks/java/gradle/wrapper/gradle-wrapper.properties +6 -0
- data/tracks/java/gradlew +172 -0
- data/tracks/java/gradlew.bat +84 -0
- data/tracks/javascript/config.json +0 -74
- data/tracks/javascript/exercises/isogram/isogram.spec.js +6 -0
- data/tracks/php/config.json +5 -0
- data/tracks/php/exercises/prime-factors/example.php +13 -0
- data/tracks/php/exercises/prime-factors/prime-factors_test.php +46 -0
- data/tracks/ruby/exercises/isogram/.meta/.version +1 -1
- data/tracks/ruby/exercises/isogram/.meta/generator/isogram_case.rb +15 -1
- data/tracks/ruby/exercises/isogram/isogram_test.rb +10 -10
- data/tracks/ruby/exercises/sum-of-multiples/.meta/.version +1 -0
- data/tracks/ruby/exercises/sum-of-multiples/.meta/generator/sum_of_multiples_case.rb +11 -0
- data/tracks/ruby/exercises/sum-of-multiples/.meta/solutions/sum_of_multiples.rb +4 -0
- data/tracks/ruby/exercises/sum-of-multiples/sum_of_multiples_test.rb +51 -12
- data/tracks/rust/exercises/forth/example.rs +2 -6
- data/tracks/rust/exercises/forth/tests/forth.rs +18 -18
- metadata +10 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 74cde339f5cdb1ac6755c1107093a003ebe1aa59
|
4
|
+
data.tar.gz: a504d24c826d0e30cb2ba137a09768679be8a11c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5618589cbec041969591deecf786a8603074d858d17f68ef8200fad1e42ab9c6dd6d726d15e348c79050bc5beb592e44cb5123aa74683bd56277fbde2957c69f
|
7
|
+
data.tar.gz: 596445c4128d4f3080a3c81c766793d47ea6baed7cb3ed9fdd865c644d6cab3e83cec0e5b55d6e189b47d8ae58461c33d5f5bdc412b5290e0b51076110951091
|
data/lib/trackler/version.rb
CHANGED
data/tracks/delphi/SETUP.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
## Testing
|
2
2
|
|
3
3
|
In order to run the tests for this track, you will need to install
|
4
|
-
DUnitX. Please see [installation](http://www.exercism.io/languages/delphi/installing) instructions for more information.
|
4
|
+
DUnitX. Please see the [installation](http://www.exercism.io/languages/delphi/installing) instructions for more information.
|
5
5
|
|
6
6
|
### Loading Exercises into Delphi
|
7
7
|
|
data/tracks/ecmascript/Makefile
CHANGED
@@ -13,10 +13,12 @@ TSTFILE := "$(subst _,-,$(ASSIGNMENT)).spec.$(FILEEXT)"
|
|
13
13
|
|
14
14
|
# package.json MD5 hash
|
15
15
|
SOURCE_PKG_MD5 ?= "`./bin/md5-hash ./package.json`"
|
16
|
-
PKG_FILES= $(shell find ./exercises/*/* -name package.json)
|
16
|
+
PKG_FILES= $(shell find ./exercises/*/* -maxdepth 1 -name package.json)
|
17
17
|
|
18
18
|
test-package-files:
|
19
|
-
@for pkg in $(PKG_FILES); do
|
19
|
+
@for pkg in $(PKG_FILES); do \
|
20
|
+
! ./bin/md5-hash $$pkg | grep -qv $(SOURCE_PKG_MD5) || { echo "$$pkg does not match main package.json"; exit 1; }; \
|
21
|
+
done
|
20
22
|
|
21
23
|
test-assignment:
|
22
24
|
@cp package.json exercises/$(ASSIGNMENT)
|
@@ -31,5 +33,4 @@ test-assignment:
|
|
31
33
|
@rmdir $(OUTDIR)
|
32
34
|
|
33
35
|
test:
|
34
|
-
@$(MAKE) -s test-package-files
|
35
36
|
@for assignment in $(ASSIGNMENTS); do ASSIGNMENT=$$assignment $(MAKE) -s test-assignment || exit 1; done
|
@@ -4,71 +4,6 @@
|
|
4
4
|
"repository": "https://github.com/exercism/xecmascript",
|
5
5
|
"active": true,
|
6
6
|
"test_pattern": ".*[.]spec[.]js$",
|
7
|
-
"problems": [
|
8
|
-
"hello-world",
|
9
|
-
"leap",
|
10
|
-
"hamming",
|
11
|
-
"rna-transcription",
|
12
|
-
"bob",
|
13
|
-
"gigasecond",
|
14
|
-
"perfect-numbers",
|
15
|
-
"word-count",
|
16
|
-
"pangram",
|
17
|
-
"beer-song",
|
18
|
-
"phone-number",
|
19
|
-
"anagram",
|
20
|
-
"food-chain",
|
21
|
-
"grade-school",
|
22
|
-
"robot-name",
|
23
|
-
"etl",
|
24
|
-
"space-age",
|
25
|
-
"grains",
|
26
|
-
"triangle",
|
27
|
-
"clock",
|
28
|
-
"acronym",
|
29
|
-
"scrabble-score",
|
30
|
-
"roman-numerals",
|
31
|
-
"circular-buffer",
|
32
|
-
"prime-factors",
|
33
|
-
"raindrops",
|
34
|
-
"allergies",
|
35
|
-
"strain",
|
36
|
-
"atbash-cipher",
|
37
|
-
"accumulate",
|
38
|
-
"crypto-square",
|
39
|
-
"sieve",
|
40
|
-
"simple-cipher",
|
41
|
-
"luhn",
|
42
|
-
"pig-latin",
|
43
|
-
"pythagorean-triplet",
|
44
|
-
"series",
|
45
|
-
"difference-of-squares",
|
46
|
-
"secret-handshake",
|
47
|
-
"linked-list",
|
48
|
-
"wordy",
|
49
|
-
"largest-series-product",
|
50
|
-
"kindergarten-garden",
|
51
|
-
"binary-search",
|
52
|
-
"binary-search-tree",
|
53
|
-
"matrix",
|
54
|
-
"robot-simulator",
|
55
|
-
"nth-prime",
|
56
|
-
"palindrome-products",
|
57
|
-
"pascals-triangle",
|
58
|
-
"say",
|
59
|
-
"custom-set",
|
60
|
-
"sum-of-multiples",
|
61
|
-
"queen-attack",
|
62
|
-
"saddle-points",
|
63
|
-
"ocr-numbers",
|
64
|
-
"meetup",
|
65
|
-
"bracket-push",
|
66
|
-
"two-bucket",
|
67
|
-
"diamond",
|
68
|
-
"isogram",
|
69
|
-
"all-your-base",
|
70
|
-
"connect"
|
71
|
-
],
|
72
7
|
"exercises": [
|
73
8
|
{
|
74
9
|
"slug": "hello-world",
|
@@ -11,6 +11,7 @@
|
|
11
11
|
"devDependencies": {
|
12
12
|
"babel-jest": "^20.0.1",
|
13
13
|
"babel-preset-env": "^1.4.0",
|
14
|
+
"babel-plugin-transform-builtin-extend": "^1.1.2",
|
14
15
|
"eslint": "^3.19.0",
|
15
16
|
"jest": "^20.0.1"
|
16
17
|
},
|
@@ -22,6 +23,11 @@
|
|
22
23
|
"babel": {
|
23
24
|
"presets": [
|
24
25
|
"env"
|
26
|
+
],
|
27
|
+
"plugins": [
|
28
|
+
["babel-plugin-transform-builtin-extend", {
|
29
|
+
"globals": ["Error"]
|
30
|
+
}]
|
25
31
|
]
|
26
32
|
},
|
27
33
|
"scripts": {
|
@@ -11,6 +11,7 @@
|
|
11
11
|
"devDependencies": {
|
12
12
|
"babel-jest": "^20.0.1",
|
13
13
|
"babel-preset-env": "^1.4.0",
|
14
|
+
"babel-plugin-transform-builtin-extend": "^1.1.2",
|
14
15
|
"eslint": "^3.19.0",
|
15
16
|
"jest": "^20.0.1"
|
16
17
|
},
|
@@ -22,6 +23,11 @@
|
|
22
23
|
"babel": {
|
23
24
|
"presets": [
|
24
25
|
"env"
|
26
|
+
],
|
27
|
+
"plugins": [
|
28
|
+
["babel-plugin-transform-builtin-extend", {
|
29
|
+
"globals": ["Error"]
|
30
|
+
}]
|
25
31
|
]
|
26
32
|
},
|
27
33
|
"scripts": {
|
@@ -11,6 +11,7 @@
|
|
11
11
|
"devDependencies": {
|
12
12
|
"babel-jest": "^20.0.1",
|
13
13
|
"babel-preset-env": "^1.4.0",
|
14
|
+
"babel-plugin-transform-builtin-extend": "^1.1.2",
|
14
15
|
"eslint": "^3.19.0",
|
15
16
|
"jest": "^20.0.1"
|
16
17
|
},
|
@@ -22,6 +23,11 @@
|
|
22
23
|
"babel": {
|
23
24
|
"presets": [
|
24
25
|
"env"
|
26
|
+
],
|
27
|
+
"plugins": [
|
28
|
+
["babel-plugin-transform-builtin-extend", {
|
29
|
+
"globals": ["Error"]
|
30
|
+
}]
|
25
31
|
]
|
26
32
|
},
|
27
33
|
"scripts": {
|
@@ -11,6 +11,7 @@
|
|
11
11
|
"devDependencies": {
|
12
12
|
"babel-jest": "^20.0.1",
|
13
13
|
"babel-preset-env": "^1.4.0",
|
14
|
+
"babel-plugin-transform-builtin-extend": "^1.1.2",
|
14
15
|
"eslint": "^3.19.0",
|
15
16
|
"jest": "^20.0.1"
|
16
17
|
},
|
@@ -22,6 +23,11 @@
|
|
22
23
|
"babel": {
|
23
24
|
"presets": [
|
24
25
|
"env"
|
26
|
+
],
|
27
|
+
"plugins": [
|
28
|
+
["babel-plugin-transform-builtin-extend", {
|
29
|
+
"globals": ["Error"]
|
30
|
+
}]
|
25
31
|
]
|
26
32
|
},
|
27
33
|
"scripts": {
|
@@ -11,6 +11,7 @@
|
|
11
11
|
"devDependencies": {
|
12
12
|
"babel-jest": "^20.0.1",
|
13
13
|
"babel-preset-env": "^1.4.0",
|
14
|
+
"babel-plugin-transform-builtin-extend": "^1.1.2",
|
14
15
|
"eslint": "^3.19.0",
|
15
16
|
"jest": "^20.0.1"
|
16
17
|
},
|
@@ -22,6 +23,11 @@
|
|
22
23
|
"babel": {
|
23
24
|
"presets": [
|
24
25
|
"env"
|
26
|
+
],
|
27
|
+
"plugins": [
|
28
|
+
["babel-plugin-transform-builtin-extend", {
|
29
|
+
"globals": ["Error"]
|
30
|
+
}]
|
25
31
|
]
|
26
32
|
},
|
27
33
|
"scripts": {
|
@@ -11,6 +11,7 @@
|
|
11
11
|
"devDependencies": {
|
12
12
|
"babel-jest": "^20.0.1",
|
13
13
|
"babel-preset-env": "^1.4.0",
|
14
|
+
"babel-plugin-transform-builtin-extend": "^1.1.2",
|
14
15
|
"eslint": "^3.19.0",
|
15
16
|
"jest": "^20.0.1"
|
16
17
|
},
|
@@ -22,6 +23,11 @@
|
|
22
23
|
"babel": {
|
23
24
|
"presets": [
|
24
25
|
"env"
|
26
|
+
],
|
27
|
+
"plugins": [
|
28
|
+
["babel-plugin-transform-builtin-extend", {
|
29
|
+
"globals": ["Error"]
|
30
|
+
}]
|
25
31
|
]
|
26
32
|
},
|
27
33
|
"scripts": {
|
@@ -11,6 +11,7 @@
|
|
11
11
|
"devDependencies": {
|
12
12
|
"babel-jest": "^20.0.1",
|
13
13
|
"babel-preset-env": "^1.4.0",
|
14
|
+
"babel-plugin-transform-builtin-extend": "^1.1.2",
|
14
15
|
"eslint": "^3.19.0",
|
15
16
|
"jest": "^20.0.1"
|
16
17
|
},
|
@@ -22,6 +23,11 @@
|
|
22
23
|
"babel": {
|
23
24
|
"presets": [
|
24
25
|
"env"
|
26
|
+
],
|
27
|
+
"plugins": [
|
28
|
+
["babel-plugin-transform-builtin-extend", {
|
29
|
+
"globals": ["Error"]
|
30
|
+
}]
|
25
31
|
]
|
26
32
|
},
|
27
33
|
"scripts": {
|
@@ -11,6 +11,7 @@
|
|
11
11
|
"devDependencies": {
|
12
12
|
"babel-jest": "^20.0.1",
|
13
13
|
"babel-preset-env": "^1.4.0",
|
14
|
+
"babel-plugin-transform-builtin-extend": "^1.1.2",
|
14
15
|
"eslint": "^3.19.0",
|
15
16
|
"jest": "^20.0.1"
|
16
17
|
},
|
@@ -22,6 +23,11 @@
|
|
22
23
|
"babel": {
|
23
24
|
"presets": [
|
24
25
|
"env"
|
26
|
+
],
|
27
|
+
"plugins": [
|
28
|
+
["babel-plugin-transform-builtin-extend", {
|
29
|
+
"globals": ["Error"]
|
30
|
+
}]
|
25
31
|
]
|
26
32
|
},
|
27
33
|
"scripts": {
|
@@ -11,6 +11,7 @@
|
|
11
11
|
"devDependencies": {
|
12
12
|
"babel-jest": "^20.0.1",
|
13
13
|
"babel-preset-env": "^1.4.0",
|
14
|
+
"babel-plugin-transform-builtin-extend": "^1.1.2",
|
14
15
|
"eslint": "^3.19.0",
|
15
16
|
"jest": "^20.0.1"
|
16
17
|
},
|
@@ -22,6 +23,11 @@
|
|
22
23
|
"babel": {
|
23
24
|
"presets": [
|
24
25
|
"env"
|
26
|
+
],
|
27
|
+
"plugins": [
|
28
|
+
["babel-plugin-transform-builtin-extend", {
|
29
|
+
"globals": ["Error"]
|
30
|
+
}]
|
25
31
|
]
|
26
32
|
},
|
27
33
|
"scripts": {
|
@@ -11,6 +11,7 @@
|
|
11
11
|
"devDependencies": {
|
12
12
|
"babel-jest": "^20.0.1",
|
13
13
|
"babel-preset-env": "^1.4.0",
|
14
|
+
"babel-plugin-transform-builtin-extend": "^1.1.2",
|
14
15
|
"eslint": "^3.19.0",
|
15
16
|
"jest": "^20.0.1"
|
16
17
|
},
|
@@ -22,6 +23,11 @@
|
|
22
23
|
"babel": {
|
23
24
|
"presets": [
|
24
25
|
"env"
|
26
|
+
],
|
27
|
+
"plugins": [
|
28
|
+
["babel-plugin-transform-builtin-extend", {
|
29
|
+
"globals": ["Error"]
|
30
|
+
}]
|
25
31
|
]
|
26
32
|
},
|
27
33
|
"scripts": {
|
@@ -11,6 +11,7 @@
|
|
11
11
|
"devDependencies": {
|
12
12
|
"babel-jest": "^20.0.1",
|
13
13
|
"babel-preset-env": "^1.4.0",
|
14
|
+
"babel-plugin-transform-builtin-extend": "^1.1.2",
|
14
15
|
"eslint": "^3.19.0",
|
15
16
|
"jest": "^20.0.1"
|
16
17
|
},
|
@@ -22,6 +23,11 @@
|
|
22
23
|
"babel": {
|
23
24
|
"presets": [
|
24
25
|
"env"
|
26
|
+
],
|
27
|
+
"plugins": [
|
28
|
+
["babel-plugin-transform-builtin-extend", {
|
29
|
+
"globals": ["Error"]
|
30
|
+
}]
|
25
31
|
]
|
26
32
|
},
|
27
33
|
"scripts": {
|
@@ -11,6 +11,7 @@
|
|
11
11
|
"devDependencies": {
|
12
12
|
"babel-jest": "^20.0.1",
|
13
13
|
"babel-preset-env": "^1.4.0",
|
14
|
+
"babel-plugin-transform-builtin-extend": "^1.1.2",
|
14
15
|
"eslint": "^3.19.0",
|
15
16
|
"jest": "^20.0.1"
|
16
17
|
},
|
@@ -22,6 +23,11 @@
|
|
22
23
|
"babel": {
|
23
24
|
"presets": [
|
24
25
|
"env"
|
26
|
+
],
|
27
|
+
"plugins": [
|
28
|
+
["babel-plugin-transform-builtin-extend", {
|
29
|
+
"globals": ["Error"]
|
30
|
+
}]
|
25
31
|
]
|
26
32
|
},
|
27
33
|
"scripts": {
|
@@ -1,20 +1,18 @@
|
|
1
1
|
import circularBuffer from './circular-buffer';
|
2
|
-
import {
|
3
|
-
import { bufferEmptyException as bufferEmptyException } from './circular-buffer';
|
4
|
-
|
2
|
+
import { BufferFullError, BufferEmptyError } from './circular-buffer';
|
5
3
|
|
6
4
|
describe('CircularBuffer', () => {
|
7
5
|
|
8
|
-
it('reading an empty buffer throws a
|
6
|
+
it('reading an empty buffer throws a BufferEmptyError', () => {
|
9
7
|
const buffer = circularBuffer(1);
|
10
|
-
expect(()=>buffer.read()).toThrow(
|
8
|
+
expect(()=>buffer.read()).toThrow(BufferEmptyError);
|
11
9
|
});
|
12
10
|
|
13
11
|
xit('write and read back one item', () => {
|
14
12
|
const buffer = circularBuffer(1);
|
15
13
|
buffer.write('1');
|
16
14
|
expect(buffer.read()).toBe('1');
|
17
|
-
expect(()=>buffer.read()).toThrow(
|
15
|
+
expect(()=>buffer.read()).toThrow(BufferEmptyError);
|
18
16
|
});
|
19
17
|
|
20
18
|
xit('write and read back multiple items', () => {
|
@@ -23,7 +21,7 @@ describe('CircularBuffer', () => {
|
|
23
21
|
buffer.write('2');
|
24
22
|
expect(buffer.read()).toBe('1');
|
25
23
|
expect(buffer.read()).toBe('2');
|
26
|
-
expect(()=>buffer.read()).toThrow(
|
24
|
+
expect(()=>buffer.read()).toThrow(BufferEmptyError);
|
27
25
|
});
|
28
26
|
|
29
27
|
xit('clearing a buffer', () => {
|
@@ -31,7 +29,7 @@ describe('CircularBuffer', () => {
|
|
31
29
|
buffer.write('1');
|
32
30
|
buffer.write('2');
|
33
31
|
buffer.clear();
|
34
|
-
expect(()=>buffer.read()).toThrow(
|
32
|
+
expect(()=>buffer.read()).toThrow(BufferEmptyError);
|
35
33
|
buffer.write('3');
|
36
34
|
buffer.write('4');
|
37
35
|
expect(buffer.read()).toBe('3');
|
@@ -64,11 +62,11 @@ describe('CircularBuffer', () => {
|
|
64
62
|
expect(buffer.read()).toBe('1');
|
65
63
|
});
|
66
64
|
|
67
|
-
xit('writing to a full buffer throws a
|
65
|
+
xit('writing to a full buffer throws a BufferFullError', () => {
|
68
66
|
const buffer = circularBuffer(2);
|
69
67
|
buffer.write('1');
|
70
68
|
buffer.write('2');
|
71
|
-
expect(() => buffer.write('A')).toThrow(
|
69
|
+
expect(() => buffer.write('A')).toThrow(BufferFullError);
|
72
70
|
});
|
73
71
|
|
74
72
|
xit('forced writes over write oldest item in a full buffer', () => {
|
@@ -78,7 +76,7 @@ describe('CircularBuffer', () => {
|
|
78
76
|
buffer.forceWrite('A');
|
79
77
|
expect(buffer.read()).toBe('2');
|
80
78
|
expect(buffer.read()).toBe('A');
|
81
|
-
expect(()=>buffer.read()).toThrow(
|
79
|
+
expect(()=>buffer.read()).toThrow(BufferEmptyError);
|
82
80
|
});
|
83
81
|
|
84
82
|
xit('forced writes act like write in a non-full buffer', () => {
|
@@ -87,7 +85,7 @@ describe('CircularBuffer', () => {
|
|
87
85
|
buffer.forceWrite('2');
|
88
86
|
expect(buffer.read()).toBe('1');
|
89
87
|
expect(buffer.read()).toBe('2');
|
90
|
-
expect(()=>buffer.read()).toThrow(
|
88
|
+
expect(()=>buffer.read()).toThrow(BufferEmptyError);
|
91
89
|
});
|
92
90
|
|
93
91
|
xit('alternate force write and read into full buffer', () => {
|
@@ -105,7 +103,7 @@ describe('CircularBuffer', () => {
|
|
105
103
|
expect(buffer.read()).toBe('8');
|
106
104
|
expect(buffer.read()).toBe('A');
|
107
105
|
expect(buffer.read()).toBe('B');
|
108
|
-
expect(()=>buffer.read()).toThrow(
|
106
|
+
expect(()=>buffer.read()).toThrow(BufferEmptyError);
|
109
107
|
});
|
110
108
|
|
111
109
|
});
|