trackler 2.1.0.25 → 2.1.0.26
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CONTRIBUTING.md +10 -0
- data/bin/bootstrap +6 -0
- data/common/CONTRIBUTING.md +2 -2
- data/lib/trackler/version.rb +1 -1
- data/tracks/coffeescript/LICENSE +2 -2
- data/tracks/coffeescript/README.md +0 -5
- data/tracks/coldfusion/LICENSE +2 -2
- data/tracks/coldfusion/README.md +0 -5
- data/tracks/crystal/LICENSE +2 -2
- data/tracks/crystal/README.md +0 -5
- data/tracks/dlang/.travis.yml +4 -2
- data/tracks/dlang/LICENSE +2 -2
- data/tracks/dlang/README.md +3 -6
- data/tracks/dlang/bin/test-all-exercises +20 -0
- data/tracks/dlang/bin/test-exercise +16 -0
- data/tracks/dlang/config.json +0 -18
- data/tracks/dlang/exercises/difference-of-squares/difference_of_squares.d +6 -3
- data/tracks/dlang/exercises/difference-of-squares/difference_of_squares_example.d +17 -0
- data/tracks/dlang/exercises/gigasecond/gigasecond.d +7 -3
- data/tracks/dlang/exercises/gigasecond/gigasecond_example.d +15 -0
- data/tracks/dlang/exercises/hello-world/hello_world.d +4 -3
- data/tracks/dlang/exercises/hello-world/hello_world_example.d +9 -0
- data/tracks/dlang/exercises/nucleotide-count/nucleotide_count.d +1 -1
- data/tracks/dlang/exercises/raindrops/raindrops.d +6 -3
- data/tracks/dlang/exercises/raindrops/raindrops_example.d +20 -0
- data/tracks/dlang/exercises/rna-transcription/rna_transcription.d +7 -3
- data/tracks/dlang/exercises/rna-transcription/rna_transcription_example.d +15 -0
- data/tracks/ecmascript/exercises/accumulate/package.json +25 -39
- data/tracks/ecmascript/exercises/acronym/package.json +25 -39
- data/tracks/ecmascript/exercises/all-your-base/package.json +25 -39
- data/tracks/ecmascript/exercises/allergies/package.json +25 -39
- data/tracks/ecmascript/exercises/anagram/package.json +25 -39
- data/tracks/ecmascript/exercises/atbash-cipher/package.json +25 -39
- data/tracks/ecmascript/exercises/beer-song/package.json +25 -39
- data/tracks/ecmascript/exercises/binary/package.json +25 -39
- data/tracks/ecmascript/exercises/binary-search/example.js +3 -1
- data/tracks/ecmascript/exercises/binary-search/package.json +25 -39
- data/tracks/ecmascript/exercises/binary-search-tree/package.json +25 -39
- data/tracks/ecmascript/exercises/bob/bob.js +1 -0
- data/tracks/ecmascript/exercises/bob/package.json +25 -39
- data/tracks/ecmascript/exercises/bracket-push/package.json +25 -39
- data/tracks/ecmascript/exercises/circular-buffer/package.json +25 -39
- data/tracks/ecmascript/exercises/clock/package.json +25 -39
- data/tracks/ecmascript/exercises/connect/example.js +4 -1
- data/tracks/ecmascript/exercises/connect/package.json +25 -39
- data/tracks/ecmascript/exercises/crypto-square/package.json +25 -39
- data/tracks/ecmascript/exercises/custom-set/package.json +25 -39
- data/tracks/ecmascript/exercises/diamond/example.js +3 -4
- data/tracks/ecmascript/exercises/diamond/package.json +25 -39
- data/tracks/ecmascript/exercises/difference-of-squares/package.json +25 -39
- data/tracks/ecmascript/exercises/etl/package.json +25 -39
- data/tracks/ecmascript/exercises/food-chain/package.json +25 -39
- data/tracks/ecmascript/exercises/gigasecond/package.json +25 -39
- data/tracks/ecmascript/exercises/grade-school/package.json +25 -39
- data/tracks/ecmascript/exercises/grains/lib/big-integer.js +1153 -1152
- data/tracks/ecmascript/exercises/grains/package.json +25 -39
- data/tracks/ecmascript/exercises/hamming/package.json +25 -39
- data/tracks/ecmascript/exercises/hello-world/package.json +25 -39
- data/tracks/ecmascript/exercises/hexadecimal/package.json +25 -39
- data/tracks/ecmascript/exercises/isogram/package.json +25 -39
- data/tracks/ecmascript/exercises/kindergarten-garden/package.json +25 -39
- data/tracks/ecmascript/exercises/largest-series-product/example.js +8 -2
- data/tracks/ecmascript/exercises/largest-series-product/package.json +25 -39
- data/tracks/ecmascript/exercises/leap/package.json +25 -39
- data/tracks/ecmascript/exercises/linked-list/package.json +25 -39
- data/tracks/ecmascript/exercises/luhn/package.json +25 -39
- data/tracks/ecmascript/exercises/matrix/package.json +25 -39
- data/tracks/ecmascript/exercises/meetup/example.js +3 -5
- data/tracks/ecmascript/exercises/meetup/meetup.spec.js +2 -5
- data/tracks/ecmascript/exercises/meetup/package.json +25 -39
- data/tracks/ecmascript/exercises/nth-prime/package.json +25 -39
- data/tracks/ecmascript/exercises/ocr-numbers/package.json +25 -39
- data/tracks/ecmascript/exercises/octal/package.json +25 -39
- data/tracks/ecmascript/exercises/package.json +24 -40
- data/tracks/ecmascript/exercises/palindrome-products/package.json +25 -39
- data/tracks/ecmascript/exercises/pangram/package.json +25 -39
- data/tracks/ecmascript/exercises/pascals-triangle/package.json +25 -39
- data/tracks/ecmascript/exercises/perfect-numbers/example.js +5 -7
- data/tracks/ecmascript/exercises/perfect-numbers/package.json +25 -39
- data/tracks/ecmascript/exercises/phone-number/package.json +25 -39
- data/tracks/ecmascript/exercises/pig-latin/package.json +25 -39
- data/tracks/ecmascript/exercises/prime-factors/package.json +25 -39
- data/tracks/ecmascript/exercises/pythagorean-triplet/package.json +25 -39
- data/tracks/ecmascript/exercises/queen-attack/package.json +25 -39
- data/tracks/ecmascript/exercises/queen-attack/queen-attack.spec.js +1 -2
- data/tracks/ecmascript/exercises/raindrops/package.json +25 -39
- data/tracks/ecmascript/exercises/rna-transcription/example.js +1 -2
- data/tracks/ecmascript/exercises/rna-transcription/package.json +25 -39
- data/tracks/ecmascript/exercises/robot-name/package.json +25 -39
- data/tracks/ecmascript/exercises/robot-simulator/package.json +25 -39
- data/tracks/ecmascript/exercises/roman-numerals/package.json +25 -39
- data/tracks/ecmascript/exercises/saddle-points/example.js +1 -1
- data/tracks/ecmascript/exercises/saddle-points/package.json +25 -39
- data/tracks/ecmascript/exercises/say/package.json +25 -39
- data/tracks/ecmascript/exercises/scrabble-score/package.json +25 -39
- data/tracks/ecmascript/exercises/secret-handshake/package.json +25 -39
- data/tracks/ecmascript/exercises/series/package.json +25 -39
- data/tracks/ecmascript/exercises/sieve/example.js +1 -1
- data/tracks/ecmascript/exercises/sieve/package.json +25 -39
- data/tracks/ecmascript/exercises/simple-cipher/package.json +25 -39
- data/tracks/ecmascript/exercises/space-age/package.json +25 -39
- data/tracks/ecmascript/exercises/strain/package.json +25 -39
- data/tracks/ecmascript/exercises/sum-of-multiples/package.json +25 -39
- data/tracks/ecmascript/exercises/triangle/package.json +25 -39
- data/tracks/ecmascript/exercises/trinary/package.json +25 -39
- data/tracks/ecmascript/exercises/two-bucket/package.json +25 -39
- data/tracks/ecmascript/exercises/word-count/package.json +25 -39
- data/tracks/ecmascript/exercises/wordy/package.json +25 -39
- data/tracks/ecmascript/package.json +25 -39
- data/tracks/factor/config.json +0 -6
- data/tracks/go/exercises/variable-length-quantity/.meta/gen.go +0 -8
- data/tracks/go/exercises/variable-length-quantity/cases_test.go +0 -9
- data/tracks/go/exercises/variable-length-quantity/example.go +5 -5
- data/tracks/go/exercises/variable-length-quantity/variable_length_quantity_test.go +2 -4
- data/tracks/groovy/LICENSE +2 -2
- data/tracks/groovy/README.md +0 -5
- data/tracks/haxe/LICENSE +2 -2
- data/tracks/haxe/README.md +0 -5
- data/tracks/nasm/LICENSE +21 -0
- data/tracks/nasm/README.md +1 -6
- data/tracks/nim/LICENSE +21 -0
- data/tracks/nim/README.md +0 -5
- data/tracks/plsql/LICENSE +2 -2
- data/tracks/plsql/README.md +0 -5
- data/tracks/plsql/config.json +52 -12
- data/tracks/pony/LICENSE +2 -2
- data/tracks/pony/README.md +0 -5
- data/tracks/powershell/LICENSE +21 -0
- data/tracks/powershell/README.md +0 -5
- data/tracks/prolog/LICENSE +2 -2
- data/tracks/prolog/README.md +1 -6
- data/tracks/purescript/LICENSE +2 -2
- data/tracks/purescript/README.md +0 -5
- data/tracks/ruby/exercises/meetup/.meta/solutions/meetup.rb +1 -0
- data/tracks/ruby/exercises/meetup/meetup_test.rb +0 -1
- data/tracks/sml/LICENSE +21 -0
- data/tracks/sml/README.md +0 -5
- data/tracks/tcl/LICENSE +2 -2
- data/tracks/tcl/README.md +1 -6
- data/tracks/teco/LICENSE +2 -2
- data/tracks/teco/README.md +0 -5
- data/tracks/vbnet/LICENSE +21 -0
- data/tracks/vbnet/README.md +0 -5
- data/tracks/vimscript/config.json +5 -0
- data/tracks/vimscript/exercises/scrabble-score/example.vim +21 -0
- data/tracks/vimscript/exercises/scrabble-score/scrabble_score.vader +62 -0
- data/tracks/vimscript/exercises/scrabble-score/scrabble_score.vim +16 -0
- metadata +13 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1ea219b914ea27b18a90012564e931c53e884090
|
4
|
+
data.tar.gz: df9c745c274ad3550a164005870ea87fd21f3280
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a88822ba8bd2eeab47286b16a9fb78aa3b0e6fdc0c99052f864e4f2ae9bd2d1c55a29066273aa8b4d2b8aac598de04cac5a0dd871a18b13bba7cb2271562e4de
|
7
|
+
data.tar.gz: 2f52002a03364a07944ff01a903c4da38d9859362179e043acbb7701ab03beae1eb03a800b9bc034518b732029889e86c4603a1b85c1190d5eb5755d0489c9e9
|
data/CONTRIBUTING.md
CHANGED
@@ -8,6 +8,16 @@ also included as a [git submodule][submodule] in `./common`.
|
|
8
8
|
|
9
9
|
A git submodule is essentially a project in another project.
|
10
10
|
|
11
|
+
## Development Environment
|
12
|
+
|
13
|
+
Clone the git repository, then run the bootstrap script:
|
14
|
+
|
15
|
+
```
|
16
|
+
$ git clone https://github.com/exercism/trackler.git
|
17
|
+
$ cd trackler
|
18
|
+
$ bin/bootstrap
|
19
|
+
```
|
20
|
+
|
11
21
|
## Terminology
|
12
22
|
|
13
23
|
Check out the [glossary][] for an overview of the important terms for Exercism, many
|
data/bin/bootstrap
ADDED
data/common/CONTRIBUTING.md
CHANGED
@@ -44,8 +44,8 @@ themselves. There are other guides about contributing to other parts of the Exer
|
|
44
44
|
* [Track-Level Linting With Configlet](#track-level-linting-with-configlet)
|
45
45
|
* [Git Basics](#git-basics)
|
46
46
|
* [Getting the Code](#getting-the-code)
|
47
|
-
|
48
|
-
|
47
|
+
* [Branches](#branches)
|
48
|
+
* [Commit Messages](#commit-messages)
|
49
49
|
* [Resetting `master`](#resetting-master)
|
50
50
|
* [Squashing](#squashing)
|
51
51
|
* [Resources](#resources)
|
data/lib/trackler/version.rb
CHANGED
data/tracks/coffeescript/LICENSE
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
|
1
|
+
MIT License
|
2
2
|
|
3
|
-
Copyright (c)
|
3
|
+
Copyright (c) 2017 Exercism, Inc
|
4
4
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
@@ -6,11 +6,6 @@ Exercism exercises in CoffeeScript
|
|
6
6
|
|
7
7
|
Please see the [contributing guide](https://github.com/exercism/x-api/blob/master/CONTRIBUTING.md#the-exercise-data)
|
8
8
|
|
9
|
-
## License
|
10
|
-
|
11
|
-
The MIT License (MIT)
|
12
|
-
|
13
|
-
Copyright (c) 2014 Katrina Owen, _@kytrinyx.com
|
14
9
|
|
15
10
|
### CoffeeScript icon
|
16
11
|
We were unable to find a license for the CoffeeScript logo, however we believe that it is owned by Jeremy Ashkenas, who holds the copyright on the CoffeeScript language.
|
data/tracks/coldfusion/LICENSE
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
|
1
|
+
MIT License
|
2
2
|
|
3
|
-
Copyright (c)
|
3
|
+
Copyright (c) 2017 Exercism, Inc
|
4
4
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
data/tracks/coldfusion/README.md
CHANGED
@@ -10,9 +10,4 @@ _Document how to contribute to the ColdFusion track._
|
|
10
10
|
|
11
11
|
Please see the [contributing guide](https://github.com/exercism/x-api/blob/master/CONTRIBUTING.md#the-exercise-data)
|
12
12
|
|
13
|
-
## License
|
14
|
-
|
15
|
-
The MIT License (MIT)
|
16
|
-
|
17
|
-
Copyright (c) 2015 Katrina Owen, _@kytrinyx.com
|
18
13
|
|
data/tracks/crystal/LICENSE
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
|
1
|
+
MIT License
|
2
2
|
|
3
|
-
Copyright (c)
|
3
|
+
Copyright (c) 2017 Exercism, Inc
|
4
4
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
data/tracks/crystal/README.md
CHANGED
@@ -47,11 +47,6 @@ $ bin/generate hello-world
|
|
47
47
|
|
48
48
|
Please see the [contributing guide](https://github.com/exercism/x-api/blob/master/CONTRIBUTING.md#the-exercise-data)
|
49
49
|
|
50
|
-
## License
|
51
|
-
|
52
|
-
The MIT License (MIT)
|
53
|
-
|
54
|
-
Copyright (c) 2016 Katrina Owen, _@kytrinyx.com
|
55
50
|
|
56
51
|
### Crystal logo
|
57
52
|
The Crystal logo is assumed to be owned by Manas SA. It appears to be released under version 2.0 of the Apache license, along with the Crystal codebase. It may also fall within the public domain, since the version we are using is a geometric shape. We have cropped it for use on Exercism.
|
data/tracks/dlang/.travis.yml
CHANGED
data/tracks/dlang/LICENSE
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
|
1
|
+
MIT License
|
2
2
|
|
3
|
-
Copyright (c)
|
3
|
+
Copyright (c) 2017 Exercism, Inc
|
4
4
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
data/tracks/dlang/README.md
CHANGED
@@ -2,6 +2,8 @@
|
|
2
2
|
|
3
3
|
Exercism exercises in the D Programming Language
|
4
4
|
|
5
|
+
[![Build Status](https://travis-ci.org/exercism/xdlang.svg?branch=master)](https://travis-ci.org/exercism/xdlang)
|
6
|
+
|
5
7
|
## Filenames
|
6
8
|
|
7
9
|
Each exercise is identified by a slug.
|
@@ -30,11 +32,6 @@ exercises/circular-buffer/
|
|
30
32
|
|
31
33
|
Please see the [contributing guide](https://github.com/exercism/x-api/blob/master/CONTRIBUTING.md#the-exercise-data)
|
32
34
|
|
33
|
-
## License
|
34
|
-
|
35
|
-
The MIT License (MIT)
|
36
|
-
|
37
|
-
Copyright (c) 2014 Katrina Owen, _@kytrinyx.com
|
38
35
|
|
39
36
|
### D icon
|
40
|
-
The D "Digital Mars" logo is owned by Digital Mars, Inc. Digital Mars, Inc. allows anyone to use, modify and redistribute the logo provided that the copyright holder is properly attributed. The original image is part of the D programming language "dlang.org" source repository, released under version 1.0 of the Boost Software License. We have modified the image, changing the colour scheme, to create the D icon for Exercism.
|
37
|
+
The D "Digital Mars" logo is owned by Digital Mars, Inc. Digital Mars, Inc. allows anyone to use, modify and redistribute the logo provided that the copyright holder is properly attributed. The original image is part of the D programming language "dlang.org" source repository, released under version 1.0 of the Boost Software License. We have modified the image, changing the colour scheme, to create the D icon for Exercism.
|
@@ -0,0 +1,20 @@
|
|
1
|
+
#!/bin/sh
|
2
|
+
|
3
|
+
test_one=$(dirname $0)/test-exercise
|
4
|
+
exercises=$(dirname $(dirname $0))/exercises
|
5
|
+
status=0
|
6
|
+
failed_exercises=""
|
7
|
+
|
8
|
+
for d in $exercises/*/; do
|
9
|
+
if ! $test_one $d; then
|
10
|
+
failed_exercises="$failed_exercises\n$(basename $d)"
|
11
|
+
status=1
|
12
|
+
fi
|
13
|
+
done
|
14
|
+
|
15
|
+
if [ $status -ne 0 ]; then
|
16
|
+
echo "The following exercises failed"
|
17
|
+
echo $failed_exercises
|
18
|
+
fi
|
19
|
+
|
20
|
+
exit $status
|
@@ -0,0 +1,16 @@
|
|
1
|
+
#!/bin/sh
|
2
|
+
|
3
|
+
if [ $# -eq 0 ]; then
|
4
|
+
echo "usage: $0 exercise-slug"
|
5
|
+
exit 1
|
6
|
+
fi
|
7
|
+
|
8
|
+
dir=$1
|
9
|
+
exercise=$(basename $dir)
|
10
|
+
underscored=$(echo "$exercise" | tr - _)
|
11
|
+
example="${underscored}_example"
|
12
|
+
backupext=testbak
|
13
|
+
|
14
|
+
cd $dir
|
15
|
+
|
16
|
+
dmd ${example}.d -de -w -unittest && ./$example
|
data/tracks/dlang/config.json
CHANGED
@@ -4,24 +4,6 @@
|
|
4
4
|
"repository": "https://github.com/exercism/xdlang",
|
5
5
|
"checklist_issue": 6,
|
6
6
|
"active": true,
|
7
|
-
"problems": [
|
8
|
-
"hello-world",
|
9
|
-
"gigasecond",
|
10
|
-
"rna-transcription",
|
11
|
-
"raindrops",
|
12
|
-
"bob",
|
13
|
-
"etl",
|
14
|
-
"hamming",
|
15
|
-
"nucleotide-count",
|
16
|
-
"robot-name",
|
17
|
-
"difference-of-squares",
|
18
|
-
"roman-numerals",
|
19
|
-
"series",
|
20
|
-
"triangle",
|
21
|
-
"crypto-square",
|
22
|
-
"circular-buffer",
|
23
|
-
"pangram"
|
24
|
-
],
|
25
7
|
"exercises": [
|
26
8
|
{
|
27
9
|
"slug": "hello-world",
|
@@ -1,9 +1,10 @@
|
|
1
1
|
module difference_of_squares;
|
2
2
|
|
3
|
-
|
3
|
+
unittest {
|
4
|
+
const int allTestsEnabled = 0;
|
4
5
|
|
5
|
-
void main() {
|
6
6
|
assert(squares(5).squareOfSum == 225);
|
7
|
+
static if (allTestsEnabled) {
|
7
8
|
assert(squares(10).squareOfSum == 3_025);
|
8
9
|
assert(squares(100).squareOfSum == 25_502_500);
|
9
10
|
|
@@ -15,6 +16,8 @@ void main() {
|
|
15
16
|
assert(squares(5).difference == 170);
|
16
17
|
assert(squares(10).difference == 2_640);
|
17
18
|
assert(squares(100).difference == 25_164_150);
|
19
|
+
}
|
18
20
|
|
19
|
-
writeln("All tests passed");
|
20
21
|
}
|
22
|
+
|
23
|
+
void main() {}
|
@@ -25,3 +25,20 @@ struct Squares {
|
|
25
25
|
Squares squares(uint max) pure {
|
26
26
|
return Squares(max);
|
27
27
|
}
|
28
|
+
|
29
|
+
unittest {
|
30
|
+
assert(squares(5).squareOfSum == 225);
|
31
|
+
assert(squares(10).squareOfSum == 3_025);
|
32
|
+
assert(squares(100).squareOfSum == 25_502_500);
|
33
|
+
|
34
|
+
assert(squares(5).sumOfSquares == 55);
|
35
|
+
assert(squares(10).sumOfSquares == 385);
|
36
|
+
assert(squares(100).sumOfSquares == 338_350);
|
37
|
+
|
38
|
+
assert(squares(0).difference == 0);
|
39
|
+
assert(squares(5).difference == 170);
|
40
|
+
assert(squares(10).difference == 2_640);
|
41
|
+
assert(squares(100).difference == 25_164_150);
|
42
|
+
}
|
43
|
+
|
44
|
+
void main () {}
|
@@ -1,10 +1,12 @@
|
|
1
1
|
module gigasecond;
|
2
2
|
|
3
|
-
import std.stdio;
|
4
3
|
import std.datetime;
|
5
4
|
|
6
|
-
|
5
|
+
unittest {
|
6
|
+
const int allTestsEnabled = 0;
|
7
|
+
|
7
8
|
assert(gsAnniversary(DateTime(2011, 4, 25)) == DateTime(2043, 1, 1, 1, 46, 40));
|
9
|
+
static if (allTestsEnabled) {
|
8
10
|
assert(gsAnniversary(DateTime(1977, 6, 13)) == DateTime(2009, 2, 19, 1, 46, 40));
|
9
11
|
assert(gsAnniversary(DateTime(1959, 7, 19)) == DateTime(1991, 3, 27, 1, 46, 40));
|
10
12
|
assert(gsAnniversary(DateTime(2015, 1, 24, 22, 0, 0)) == DateTime(2046, 10, 2, 23, 46, 40));
|
@@ -16,6 +18,8 @@ void main() {
|
|
16
18
|
assert(d == DateTime(2011, 4, 25));
|
17
19
|
|
18
20
|
//For fun add a test for your own gigasecond anniversary
|
21
|
+
}
|
19
22
|
|
20
|
-
writeln("All tests pass");
|
21
23
|
}
|
24
|
+
|
25
|
+
void main() {}
|
@@ -8,3 +8,18 @@ enum Gigasecond = seconds(10^^9);
|
|
8
8
|
DateTime gsAnniversary(in DateTime start) pure {
|
9
9
|
return start + Gigasecond;
|
10
10
|
}
|
11
|
+
|
12
|
+
unittest {
|
13
|
+
assert(gsAnniversary(DateTime(2011, 4, 25)) == DateTime(2043, 1, 1, 1, 46, 40));
|
14
|
+
assert(gsAnniversary(DateTime(1977, 6, 13)) == DateTime(2009, 2, 19, 1, 46, 40));
|
15
|
+
assert(gsAnniversary(DateTime(1959, 7, 19)) == DateTime(1991, 3, 27, 1, 46, 40));
|
16
|
+
assert(gsAnniversary(DateTime(2015, 1, 24, 22, 0, 0)) == DateTime(2046, 10, 2, 23, 46, 40));
|
17
|
+
assert(gsAnniversary(DateTime(2015, 1, 24, 23, 59, 59)) == DateTime(2046, 10, 3, 1, 46, 39));
|
18
|
+
|
19
|
+
//check that it doesn't mutate the argument
|
20
|
+
auto d = DateTime(2011, 4, 25);
|
21
|
+
assert(gsAnniversary(d) == DateTime(2043, 1, 1, 1, 46, 40));
|
22
|
+
assert(d == DateTime(2011, 4, 25));
|
23
|
+
}
|
24
|
+
|
25
|
+
void main () {}
|
@@ -1,12 +1,13 @@
|
|
1
1
|
module helloworld_test;
|
2
2
|
|
3
|
-
|
3
|
+
unittest {
|
4
|
+
const int allTestsEnabled = 0;
|
4
5
|
|
5
|
-
void main() {
|
6
6
|
assert(hello() == "Hello, World!");
|
7
|
+
static if (allTestsEnabled) {
|
7
8
|
assert(hello("Alice") == "Hello, Alice!");
|
8
9
|
assert(hello("Bob") == "Hello, Bob!");
|
9
10
|
assert(hello("") == "Hello, !");
|
11
|
+
}
|
10
12
|
|
11
|
-
writeln("All tests passed.");
|
12
13
|
}
|
@@ -5,3 +5,12 @@ import std.format;
|
|
5
5
|
string hello(const char[] name = "World") {
|
6
6
|
return format("Hello, %s!", name);
|
7
7
|
}
|
8
|
+
|
9
|
+
unittest {
|
10
|
+
assert(hello() == "Hello, World!");
|
11
|
+
assert(hello("Alice") == "Hello, Alice!");
|
12
|
+
assert(hello("Bob") == "Hello, Bob!");
|
13
|
+
assert(hello("") == "Hello, !");
|
14
|
+
}
|
15
|
+
|
16
|
+
void main () {}
|
@@ -10,7 +10,7 @@ unittest
|
|
10
10
|
{
|
11
11
|
|
12
12
|
// test associative array equality
|
13
|
-
bool aaEqual (const
|
13
|
+
bool aaEqual (const ulong[char] lhs, const ulong[char] rhs)
|
14
14
|
{
|
15
15
|
auto lhs_pairs = lhs.byKeyValue.array;
|
16
16
|
auto rhs_pairs = rhs.byKeyValue.array;
|
@@ -1,7 +1,8 @@
|
|
1
|
-
|
1
|
+
unittest {
|
2
|
+
const int allTestsEnabled = 0;
|
2
3
|
|
3
|
-
void main() {
|
4
4
|
assert(convert(1) == "1");
|
5
|
+
static if (allTestsEnabled) {
|
5
6
|
assert(convert(3) == "Pling");
|
6
7
|
assert(convert(5) == "Plang");
|
7
8
|
assert(convert(7) == "Plong");
|
@@ -16,6 +17,8 @@ void main() {
|
|
16
17
|
assert(convert(49) == "Plong");
|
17
18
|
assert(convert(52) == "52");
|
18
19
|
assert(convert(105) == "PlingPlangPlong");
|
20
|
+
}
|
19
21
|
|
20
|
-
writeln("All tests passed");
|
21
22
|
}
|
23
|
+
|
24
|
+
void main() {}
|
@@ -33,3 +33,23 @@ private bool isPlang(int n) {
|
|
33
33
|
private bool isPlong(int n) {
|
34
34
|
return n % 7 == 0;
|
35
35
|
}
|
36
|
+
|
37
|
+
unittest {
|
38
|
+
assert(convert(1) == "1");
|
39
|
+
assert(convert(3) == "Pling");
|
40
|
+
assert(convert(5) == "Plang");
|
41
|
+
assert(convert(7) == "Plong");
|
42
|
+
assert(convert(6) == "Pling");
|
43
|
+
assert(convert(9) == "Pling");
|
44
|
+
assert(convert(10) == "Plang");
|
45
|
+
assert(convert(14) == "Plong");
|
46
|
+
assert(convert(15) == "PlingPlang");
|
47
|
+
assert(convert(21) == "PlingPlong");
|
48
|
+
assert(convert(25) == "Plang");
|
49
|
+
assert(convert(35) == "PlangPlong");
|
50
|
+
assert(convert(49) == "Plong");
|
51
|
+
assert(convert(52) == "52");
|
52
|
+
assert(convert(105) == "PlingPlangPlong");
|
53
|
+
}
|
54
|
+
|
55
|
+
void main () {}
|
@@ -1,10 +1,12 @@
|
|
1
1
|
module rna_transcription;
|
2
2
|
|
3
3
|
import std.exception : assertThrown;
|
4
|
-
import std.stdio;
|
5
4
|
|
6
|
-
|
5
|
+
unittest {
|
6
|
+
const int allTestsEnabled = 0;
|
7
|
+
|
7
8
|
assert(dnaComplement("C") == "G");
|
9
|
+
static if (allTestsEnabled) {
|
8
10
|
assert(dnaComplement("G") == "C");
|
9
11
|
assert(dnaComplement("T") == "A");
|
10
12
|
assert(dnaComplement("A") == "U");
|
@@ -14,6 +16,8 @@ void main() {
|
|
14
16
|
assertThrown(dnaComplement("U"));
|
15
17
|
assertThrown(dnaComplement("XXX"));
|
16
18
|
assertThrown(dnaComplement("ACGTXXXCTTAA"));
|
19
|
+
}
|
17
20
|
|
18
|
-
writeln("All tests passed");
|
19
21
|
}
|
22
|
+
|
23
|
+
void main() {}
|
@@ -20,3 +20,18 @@ string dnaComplement(string dna) {
|
|
20
20
|
enforce(dna.matchFirst(dnaRegex), "Invalid DNA string");
|
21
21
|
return dna.translate(rnaTransTable);
|
22
22
|
}
|
23
|
+
|
24
|
+
unittest {
|
25
|
+
assert(dnaComplement("C") == "G");
|
26
|
+
assert(dnaComplement("G") == "C");
|
27
|
+
assert(dnaComplement("T") == "A");
|
28
|
+
assert(dnaComplement("A") == "U");
|
29
|
+
|
30
|
+
assert(dnaComplement("ACGTGGTCTTAA") == "UGCACCAGAAUU");
|
31
|
+
|
32
|
+
assertThrown(dnaComplement("U"));
|
33
|
+
assertThrown(dnaComplement("XXX"));
|
34
|
+
assertThrown(dnaComplement("ACGTXXXCTTAA"));
|
35
|
+
}
|
36
|
+
|
37
|
+
void main () {}
|
@@ -27,52 +27,38 @@
|
|
27
27
|
"scripts": {
|
28
28
|
"test": "jest --no-cache ./*",
|
29
29
|
"watch": "jest --no-cache --watch ./*",
|
30
|
-
"lint": "eslint
|
31
|
-
"lint-test": "eslint
|
30
|
+
"lint": "eslint .",
|
31
|
+
"lint-test": "eslint . && jest --no-cache ./* "
|
32
32
|
},
|
33
33
|
"eslintConfig": {
|
34
34
|
"parserOptions": {
|
35
35
|
"ecmaVersion": 6,
|
36
36
|
"sourceType": "module"
|
37
37
|
},
|
38
|
+
"env": {
|
39
|
+
"es6": true,
|
40
|
+
"node": true,
|
41
|
+
"jasmine": true
|
42
|
+
},
|
43
|
+
"extends": "eslint:recommended",
|
38
44
|
"rules": {
|
39
|
-
"
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
"
|
44
|
-
|
45
|
-
|
46
|
-
],
|
47
|
-
"no-
|
48
|
-
"
|
49
|
-
"
|
50
|
-
"
|
51
|
-
"no-
|
52
|
-
"no-
|
53
|
-
"
|
54
|
-
"
|
55
|
-
"
|
56
|
-
"no-ex-assign": 2,
|
57
|
-
"no-extra-boolean-cast": 2,
|
58
|
-
"no-extra-parens": 2,
|
59
|
-
"no-extra-semi": 2,
|
60
|
-
"no-func-assign": 2,
|
61
|
-
"no-inner-declarations": [
|
62
|
-
2,
|
63
|
-
"both"
|
64
|
-
],
|
65
|
-
"no-invalid-regexp": 2,
|
66
|
-
"no-irregular-whitespace": 2,
|
67
|
-
"no-negated-in-lhs": 2,
|
68
|
-
"no-obj-calls": 2,
|
69
|
-
"no-regex-spaces": 2,
|
70
|
-
"no-sparse-arrays": 2,
|
71
|
-
"no-unexpected-multiline": 2,
|
72
|
-
"no-unreachable": 2,
|
73
|
-
"use-isnan": 2,
|
74
|
-
"valid-jsdoc": 2,
|
75
|
-
"valid-typeof": 2
|
45
|
+
"indent": [ "off", 2 ],
|
46
|
+
"block-scoped-var": "off",
|
47
|
+
"radix": "off",
|
48
|
+
"no-use-before-define": "off",
|
49
|
+
"one-var": [ "off", "always" ],
|
50
|
+
"quotes": [ "off", "single", { "avoidEscape": true } ],
|
51
|
+
"semi": [ "off", "always" ],
|
52
|
+
"semi-spacing": [ "off", { "before": false, "after": true } ],
|
53
|
+
"no-whitespace-before-property": "off",
|
54
|
+
"space-before-blocks": [ "off", "always" ],
|
55
|
+
"space-before-function-paren": [ "off", { "anonymous": "always", "named": "never" } ],
|
56
|
+
"keyword-spacing": [ "off", { "before": true, "after": true } ],
|
57
|
+
"no-multi-spaces": "off",
|
58
|
+
"no-trailing-spaces": "off",
|
59
|
+
"curly": [ "error", "all" ],
|
60
|
+
"brace-style": [ "error", "1tbs", { "allowSingleLine": true } ],
|
61
|
+
"object-curly-spacing": [ "off", "always" ]
|
76
62
|
}
|
77
63
|
},
|
78
64
|
"licenses": [
|
@@ -27,52 +27,38 @@
|
|
27
27
|
"scripts": {
|
28
28
|
"test": "jest --no-cache ./*",
|
29
29
|
"watch": "jest --no-cache --watch ./*",
|
30
|
-
"lint": "eslint
|
31
|
-
"lint-test": "eslint
|
30
|
+
"lint": "eslint .",
|
31
|
+
"lint-test": "eslint . && jest --no-cache ./* "
|
32
32
|
},
|
33
33
|
"eslintConfig": {
|
34
34
|
"parserOptions": {
|
35
35
|
"ecmaVersion": 6,
|
36
36
|
"sourceType": "module"
|
37
37
|
},
|
38
|
+
"env": {
|
39
|
+
"es6": true,
|
40
|
+
"node": true,
|
41
|
+
"jasmine": true
|
42
|
+
},
|
43
|
+
"extends": "eslint:recommended",
|
38
44
|
"rules": {
|
39
|
-
"
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
"
|
44
|
-
|
45
|
-
|
46
|
-
],
|
47
|
-
"no-
|
48
|
-
"
|
49
|
-
"
|
50
|
-
"
|
51
|
-
"no-
|
52
|
-
"no-
|
53
|
-
"
|
54
|
-
"
|
55
|
-
"
|
56
|
-
"no-ex-assign": 2,
|
57
|
-
"no-extra-boolean-cast": 2,
|
58
|
-
"no-extra-parens": 2,
|
59
|
-
"no-extra-semi": 2,
|
60
|
-
"no-func-assign": 2,
|
61
|
-
"no-inner-declarations": [
|
62
|
-
2,
|
63
|
-
"both"
|
64
|
-
],
|
65
|
-
"no-invalid-regexp": 2,
|
66
|
-
"no-irregular-whitespace": 2,
|
67
|
-
"no-negated-in-lhs": 2,
|
68
|
-
"no-obj-calls": 2,
|
69
|
-
"no-regex-spaces": 2,
|
70
|
-
"no-sparse-arrays": 2,
|
71
|
-
"no-unexpected-multiline": 2,
|
72
|
-
"no-unreachable": 2,
|
73
|
-
"use-isnan": 2,
|
74
|
-
"valid-jsdoc": 2,
|
75
|
-
"valid-typeof": 2
|
45
|
+
"indent": [ "off", 2 ],
|
46
|
+
"block-scoped-var": "off",
|
47
|
+
"radix": "off",
|
48
|
+
"no-use-before-define": "off",
|
49
|
+
"one-var": [ "off", "always" ],
|
50
|
+
"quotes": [ "off", "single", { "avoidEscape": true } ],
|
51
|
+
"semi": [ "off", "always" ],
|
52
|
+
"semi-spacing": [ "off", { "before": false, "after": true } ],
|
53
|
+
"no-whitespace-before-property": "off",
|
54
|
+
"space-before-blocks": [ "off", "always" ],
|
55
|
+
"space-before-function-paren": [ "off", { "anonymous": "always", "named": "never" } ],
|
56
|
+
"keyword-spacing": [ "off", { "before": true, "after": true } ],
|
57
|
+
"no-multi-spaces": "off",
|
58
|
+
"no-trailing-spaces": "off",
|
59
|
+
"curly": [ "error", "all" ],
|
60
|
+
"brace-style": [ "error", "1tbs", { "allowSingleLine": true } ],
|
61
|
+
"object-curly-spacing": [ "off", "always" ]
|
76
62
|
}
|
77
63
|
},
|
78
64
|
"licenses": [
|