trackler 2.2.1.45 → 2.2.1.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/trackler/version.rb +1 -1
- data/problem-specifications/exercises/complex-numbers/description.md +27 -0
- data/problem-specifications/exercises/crypto-square/canonical-data.json +39 -43
- data/problem-specifications/exercises/crypto-square/description.md +6 -4
- data/problem-specifications/exercises/hamming/canonical-data.json +5 -5
- data/problem-specifications/exercises/kindergarten-garden/description.md +10 -10
- data/problem-specifications/exercises/leap/canonical-data.json +2 -2
- data/problem-specifications/exercises/markdown/canonical-data.json +2 -2
- data/problem-specifications/exercises/nucleotide-count/canonical-data.json +12 -1
- data/problem-specifications/exercises/pangram/canonical-data.json +7 -1
- data/problem-specifications/exercises/queen-attack/canonical-data.json +83 -26
- data/problem-specifications/exercises/space-age/description.md +1 -2
- data/problem-specifications/exercises/zipper/canonical-data.json +671 -0
- data/tracks/bash/config.json +13 -1
- data/tracks/bash/exercises/atbash-cipher/README.md +45 -0
- data/tracks/bash/exercises/atbash-cipher/atbash_cipher_tests.sh +73 -0
- data/tracks/bash/exercises/atbash-cipher/example.sh +14 -0
- data/tracks/bash/exercises/gigasecond/.meta/hints.md +33 -0
- data/tracks/bash/exercises/two-fer/README.md +0 -22
- data/tracks/c/exercises/allergies/src/allergies.h +9 -9
- data/tracks/c/exercises/allergies/src/example.c +2 -2
- data/tracks/c/exercises/allergies/src/example.h +9 -9
- data/tracks/c/exercises/allergies/test/test_allergies.c +34 -34
- data/tracks/c/exercises/clock/test/test_clock.c +0 -52
- data/tracks/c/exercises/meetup/test/test_meetup.c +604 -114
- data/tracks/c/exercises/nucleotide-count/src/example.c +10 -10
- data/tracks/c/exercises/palindrome-products/src/example.c +8 -8
- data/tracks/c/exercises/palindrome-products/src/example.h +5 -5
- data/tracks/c/exercises/palindrome-products/test/test_palindrome_products.c +8 -6
- data/tracks/c/exercises/robot-simulator/src/example.c +19 -19
- data/tracks/c/exercises/robot-simulator/src/robot_simulator.h +24 -24
- data/tracks/c/exercises/robot-simulator/test/test_robot_simulator.c +35 -34
- data/tracks/c/exercises/series/src/example.c +10 -10
- data/tracks/c/exercises/series/src/series.h +5 -5
- data/tracks/c/exercises/series/test/test_series.c +77 -30
- data/tracks/c/exercises/sieve/src/example.c +17 -17
- data/tracks/c/exercises/sieve/src/sieve.h +2 -2
- data/tracks/c/exercises/sieve/test/test_sieve.c +6 -6
- data/tracks/c/exercises/space-age/src/example.c +1 -1
- data/tracks/c/exercises/space-age/src/example.h +3 -3
- data/tracks/c/exercises/space-age/test/test_space_age.c +2 -0
- data/tracks/c/exercises/sum-of-multiples/src/example.c +3 -1
- data/tracks/c/exercises/sum-of-multiples/test/test_sum_of_multiples.c +17 -0
- data/tracks/c/exercises/triangle/src/example.c +4 -4
- data/tracks/c/exercises/triangle/src/example.h +4 -4
- data/tracks/c/exercises/triangle/src/triangle.h +1 -1
- data/tracks/c/exercises/triangle/test/test_triangle.c +18 -16
- data/tracks/c/exercises/word-count/src/example.c +24 -24
- data/tracks/c/exercises/word-count/src/word_count.h +3 -3
- data/tracks/c/exercises/word-count/test/test_word_count.c +139 -139
- data/tracks/cfml/exercises/acronym/README.md +31 -0
- data/tracks/cfml/exercises/atbash-cipher/README.md +50 -0
- data/tracks/cfml/exercises/bob/README.md +34 -0
- data/tracks/cfml/exercises/diamond/README.md +75 -0
- data/tracks/cfml/exercises/difference-of-squares/README.md +35 -0
- data/tracks/cfml/exercises/flatten-array/README.md +34 -0
- data/tracks/cfml/exercises/gigasecond/README.md +27 -0
- data/tracks/cfml/exercises/grains/README.md +50 -0
- data/tracks/cfml/exercises/hamming/README.md +58 -0
- data/tracks/cfml/exercises/hello-world/README.md +37 -0
- data/tracks/cfml/exercises/isogram/README.md +35 -0
- data/tracks/cfml/exercises/largest-series-product/README.md +36 -0
- data/tracks/cfml/exercises/leap/README.md +16 -0
- data/tracks/cfml/exercises/luhn/README.md +87 -0
- data/tracks/cfml/exercises/markdown/README.md +34 -0
- data/tracks/cfml/exercises/nth-prime/README.md +31 -0
- data/tracks/cfml/exercises/pangram/README.md +31 -0
- data/tracks/cfml/exercises/pig-latin/README.md +40 -0
- data/tracks/cfml/exercises/raindrops/README.md +40 -0
- data/tracks/cfml/exercises/rna-transcription/README.md +41 -0
- data/tracks/cfml/exercises/saddle-points/README.md +49 -0
- data/tracks/cfml/exercises/scrabble-score/README.md +60 -0
- data/tracks/cfml/exercises/secret-handshake/README.md +51 -0
- data/tracks/cfml/exercises/space-age/README.md +41 -0
- data/tracks/cfml/exercises/sum-of-multiples/README.md +34 -0
- data/tracks/cfml/exercises/triangle/README.md +42 -0
- data/tracks/cfml/exercises/word-count/README.md +35 -0
- data/tracks/clojure/config.json +10 -0
- data/tracks/clojure/exercises/spiral-matrix/README.md +32 -0
- data/tracks/clojure/exercises/spiral-matrix/project.clj +4 -0
- data/tracks/clojure/exercises/spiral-matrix/src/example.clj +11 -0
- data/tracks/clojure/exercises/spiral-matrix/src/spiral_matrix.clj +3 -0
- data/tracks/clojure/exercises/spiral-matrix/test/spiral_matrix_test.clj +58 -0
- data/tracks/common-lisp/config.json +20 -0
- data/tracks/common-lisp/exercises/hello-world/README.md +68 -0
- data/tracks/common-lisp/exercises/hello-world/example.lisp +9 -0
- data/tracks/common-lisp/exercises/hello-world/hello-world-test.lisp +21 -0
- data/tracks/common-lisp/exercises/hello-world/hello-world.lisp +6 -0
- data/tracks/common-lisp/exercises/perfect-numbers/README.md +72 -0
- data/tracks/common-lisp/exercises/perfect-numbers/example.lisp +17 -0
- data/tracks/common-lisp/exercises/perfect-numbers/perfect-numbers-test.lisp +56 -0
- data/tracks/common-lisp/exercises/perfect-numbers/perfect-numbers.lisp +7 -0
- data/tracks/cpp/.travis.yml +34 -14
- data/tracks/cpp/docs/INSTALLATION.md +17 -28
- data/tracks/cpp/docs/TESTS.md +13 -21
- data/tracks/crystal/config.json +10 -0
- data/tracks/crystal/exercises/triangle/spec/triangle_spec.cr +60 -0
- data/tracks/crystal/exercises/triangle/src/example.cr +31 -0
- data/tracks/crystal/exercises/triangle/src/triangle.cr +1 -0
- data/tracks/crystal/generator/spec/remote_data_file_spec.cr +0 -1
- data/tracks/crystal/generator/src/generators/triangle.cr +38 -0
- data/tracks/crystal/generator/src/remote_data_file.cr +1 -1
- data/tracks/csharp/exercises/difference-of-squares/DifferenceOfSquares.cs +4 -4
- data/tracks/csharp/exercises/difference-of-squares/DifferenceOfSquaresTest.cs +22 -27
- data/tracks/csharp/exercises/difference-of-squares/Example.cs +5 -5
- data/tracks/csharp/exercises/error-handling/ErrorHandlingTest.cs +4 -4
- data/tracks/csharp/exercises/flatten-array/Example.cs +1 -1
- data/tracks/csharp/exercises/flatten-array/FlattenArray.cs +1 -1
- data/tracks/csharp/exercises/flatten-array/FlattenArrayTest.cs +106 -72
- data/tracks/csharp/exercises/largest-series-product/LargestSeriesProductTest.cs +24 -98
- data/tracks/csharp/exercises/minesweeper/Example.cs +3 -3
- data/tracks/csharp/exercises/minesweeper/Minesweeper.cs +1 -1
- data/tracks/csharp/exercises/minesweeper/MinesweeperTest.cs +155 -57
- data/tracks/csharp/generators/Exercises/DifferenceOfSquares.cs +25 -0
- data/tracks/csharp/generators/Exercises/FlattenArray.cs +36 -0
- data/tracks/csharp/generators/Exercises/LargestSeriesProduct.cs +18 -0
- data/tracks/csharp/generators/Exercises/Minesweeper.cs +32 -0
- data/tracks/d/docs/EXERCISE_README_INSERT.md +1 -1
- data/tracks/d/exercises/bob/README.md +1 -1
- data/tracks/d/exercises/circular-buffer/README.md +1 -1
- data/tracks/d/exercises/crypto-square/README.md +1 -1
- data/tracks/d/exercises/difference-of-squares/README.md +1 -1
- data/tracks/d/exercises/etl/README.md +1 -1
- data/tracks/d/exercises/gigasecond/README.md +1 -1
- data/tracks/d/exercises/hamming/README.md +1 -1
- data/tracks/d/exercises/hello-world/README.md +1 -1
- data/tracks/d/exercises/leap/README.md +1 -1
- data/tracks/d/exercises/nucleotide-count/README.md +1 -1
- data/tracks/d/exercises/pangram/README.md +1 -1
- data/tracks/d/exercises/raindrops/README.md +1 -1
- data/tracks/d/exercises/react/README.md +1 -1
- data/tracks/d/exercises/rna-transcription/README.md +1 -1
- data/tracks/d/exercises/robot-name/README.md +1 -1
- data/tracks/d/exercises/roman-numerals/README.md +1 -1
- data/tracks/d/exercises/series/README.md +1 -1
- data/tracks/d/exercises/triangle/README.md +1 -1
- data/tracks/dart/CONTRIBUTING.md +61 -0
- data/tracks/dart/README.md +10 -47
- data/tracks/dart/config.json +13 -1
- data/tracks/dart/exercises/anagram/README.md +10 -0
- data/tracks/dart/exercises/bob/README.md +11 -0
- data/tracks/dart/exercises/difference-of-squares/README.md +11 -0
- data/tracks/dart/exercises/gigasecond/README.md +11 -0
- data/tracks/dart/exercises/gigasecond/test/gigasecond_test.dart +56 -33
- data/tracks/dart/exercises/hamming/README.md +11 -0
- data/tracks/dart/exercises/hamming/lib/example.dart +2 -2
- data/tracks/dart/exercises/hamming/test/hamming_test.dart +41 -24
- data/tracks/dart/exercises/hello-world/README.md +11 -0
- data/tracks/dart/exercises/leap/README.md +12 -1
- data/tracks/dart/exercises/phone-number/README.md +56 -0
- data/tracks/dart/exercises/phone-number/lib/example.dart +45 -0
- data/tracks/dart/exercises/phone-number/lib/phone_number.dart +3 -0
- data/tracks/dart/exercises/phone-number/pubspec.lock +293 -0
- data/tracks/dart/exercises/phone-number/pubspec.yaml +3 -0
- data/tracks/dart/exercises/phone-number/test/phone_number_test.dart +66 -0
- data/tracks/dart/exercises/raindrops/README.md +35 -0
- data/tracks/dart/exercises/rna-transcription/README.md +11 -0
- data/tracks/dart/exercises/word-count/README.md +14 -3
- data/tracks/delphi/docs/RESOURCES.md +10 -11
- data/tracks/elixir/exercises/hello-world/hello_world.exs +1 -1
- data/tracks/elixir/exercises/secret-handshake/README.md +3 -5
- data/tracks/elm/exercises/isogram/Isogram.example.elm +4 -4
- data/tracks/erlang/config.json +10 -0
- data/tracks/erlang/exercises/sieve/README.md +88 -0
- data/tracks/erlang/exercises/sieve/include/exercism.hrl +11 -0
- data/tracks/erlang/exercises/sieve/rebar.config +30 -0
- data/tracks/erlang/exercises/sieve/src/example.erl +16 -0
- data/tracks/erlang/exercises/sieve/src/sieve.app.src +9 -0
- data/tracks/erlang/exercises/sieve/src/sieve.erl +8 -0
- data/tracks/erlang/exercises/sieve/test/sieve_tests.erl +38 -0
- data/tracks/fsharp/.gitignore +2 -1
- data/tracks/fsharp/exercises/crypto-square/CryptoSquareTest.fs +10 -6
- data/tracks/fsharp/exercises/leap/LeapTest.fs +2 -2
- data/tracks/fsharp/exercises/pangram/PangramTest.fs +5 -1
- data/tracks/fsharp/exercises/queen-attack/QueenAttackTest.fs +7 -7
- data/tracks/fsharp/exercises/run-length-encoding/Example.fs +2 -2
- data/tracks/fsharp/exercises/run-length-encoding/RunLengthEncodingTest.fs +42 -30
- data/tracks/fsharp/generators/Generators.fs +21 -8
- data/tracks/gnu-apl/test.apl +4 -4
- data/tracks/go/README.md +1 -2
- data/tracks/go/config/maintainers.json +5 -6
- data/tracks/groovy/config.json +23 -0
- data/tracks/groovy/exercises/binary-search/BinarySearch.groovy +14 -0
- data/tracks/groovy/exercises/binary-search/BinarySearchSpec.groovy +56 -0
- data/tracks/groovy/exercises/binary-search/Example.groovy +43 -0
- data/tracks/groovy/exercises/binary-search/README.md +59 -0
- data/tracks/groovy/exercises/triangle/Example.groovy +23 -0
- data/tracks/groovy/exercises/triangle/README.md +42 -0
- data/tracks/groovy/exercises/triangle/Triangle.groovy +15 -0
- data/tracks/groovy/exercises/triangle/TriangleSpec.groovy +66 -0
- data/tracks/haskell/config.json +9 -0
- data/tracks/haskell/exercises/all-your-base/package.yaml +1 -1
- data/tracks/haskell/exercises/all-your-base/test/Tests.hs +18 -18
- data/tracks/haskell/exercises/bowling/package.yaml +1 -1
- data/tracks/haskell/exercises/bowling/test/Tests.hs +9 -9
- data/tracks/haskell/exercises/change/package.yaml +1 -1
- data/tracks/haskell/exercises/change/test/Tests.hs +5 -0
- data/tracks/haskell/exercises/complex-numbers/README.md +92 -0
- data/tracks/haskell/exercises/complex-numbers/examples/success-standard/package.yaml +16 -0
- data/tracks/haskell/exercises/complex-numbers/examples/success-standard/src/ComplexNumbers.hs +50 -0
- data/tracks/haskell/exercises/complex-numbers/package.yaml +20 -0
- data/tracks/haskell/exercises/complex-numbers/src/ComplexNumbers.hs +45 -0
- data/tracks/haskell/exercises/complex-numbers/stack.yaml +1 -0
- data/tracks/haskell/exercises/complex-numbers/test/Tests.hs +194 -0
- data/tracks/haskell/exercises/crypto-square/package.yaml +1 -1
- data/tracks/haskell/exercises/crypto-square/test/Tests.hs +20 -12
- data/tracks/haskell/exercises/dominoes/package.yaml +1 -1
- data/tracks/haskell/exercises/forth/package.yaml +1 -1
- data/tracks/haskell/exercises/forth/test/Tests.hs +4 -3
- data/tracks/haskell/exercises/hamming/package.yaml +1 -1
- data/tracks/haskell/exercises/hamming/test/Tests.hs +6 -6
- data/tracks/haskell/exercises/isogram/package.yaml +1 -1
- data/tracks/haskell/exercises/isogram/test/Tests.hs +2 -2
- data/tracks/haskell/exercises/leap/package.yaml +1 -1
- data/tracks/haskell/exercises/leap/test/Tests.hs +1 -1
- data/tracks/haskell/exercises/pascals-triangle/package.yaml +1 -1
- data/tracks/haskell/exercises/pig-latin/examples/success-standard/src/PigLatin.hs +2 -0
- data/tracks/haskell/exercises/pig-latin/package.yaml +1 -1
- data/tracks/haskell/exercises/pig-latin/test/Tests.hs +8 -0
- data/tracks/haskell/exercises/queen-attack/package.yaml +1 -1
- data/tracks/haskell/exercises/rna-transcription/package.yaml +1 -1
- data/tracks/haskell/exercises/rna-transcription/test/Tests.hs +8 -8
- data/tracks/haskell/exercises/robot-simulator/package.yaml +1 -1
- data/tracks/haskell/exercises/secret-handshake/package.yaml +1 -1
- data/tracks/haskell/exercises/secret-handshake/test/Tests.hs +0 -3
- data/tracks/haskell/exercises/sum-of-multiples/package.yaml +1 -1
- data/tracks/haskell/exercises/sum-of-multiples/test/Tests.hs +4 -0
- data/tracks/haskell/exercises/zipper/package.yaml +1 -1
- data/tracks/haskell/exercises/zipper/test/Tests.hs +23 -0
- data/tracks/java/config.json +85 -13
- data/tracks/java/config/maintainers.json +1 -1
- data/tracks/java/exercises/accumulate/README.md +0 -3
- data/tracks/java/exercises/acronym/.meta/.version +1 -0
- data/tracks/java/exercises/acronym/README.md +0 -1
- data/tracks/java/exercises/acronym/src/test/java/AcronymTest.java +0 -3
- data/tracks/java/exercises/all-your-base/.meta/.version +1 -0
- data/tracks/java/exercises/all-your-base/README.md +1 -1
- data/tracks/java/exercises/all-your-base/src/test/java/BaseConverterTest.java +0 -3
- data/tracks/java/exercises/allergies/README.md +0 -1
- data/tracks/java/exercises/atbash-cipher/README.md +2 -1
- data/tracks/java/exercises/beer-song/README.md +1 -1
- data/tracks/java/exercises/binary/README.md +2 -0
- data/tracks/java/exercises/book-store/README.md +5 -5
- data/tracks/java/exercises/bowling/README.md +20 -6
- data/tracks/java/exercises/change/.meta/.version +1 -0
- data/tracks/java/exercises/change/README.md +1 -1
- data/tracks/java/exercises/change/src/test/java/ChangeCalculatorTest.java +0 -3
- data/tracks/java/exercises/circular-buffer/README.md +13 -6
- data/tracks/java/exercises/clock/.meta/.version +1 -0
- data/tracks/java/exercises/clock/src/test/java/ClockAddTest.java +0 -3
- data/tracks/java/exercises/clock/src/test/java/ClockCreationTest.java +0 -3
- data/tracks/java/exercises/clock/src/test/java/ClockEqualTest.java +0 -3
- data/tracks/java/exercises/collatz-conjecture/.meta/.version +1 -0
- data/tracks/java/exercises/collatz-conjecture/README.md +1 -1
- data/tracks/java/exercises/collatz-conjecture/src/test/java/CollatzCalculatorTest.java +0 -3
- data/tracks/java/exercises/complex-numbers/README.md +27 -0
- data/tracks/java/exercises/crypto-square/README.md +10 -8
- data/tracks/java/exercises/diamond/.meta/.version +1 -0
- data/tracks/java/exercises/diamond/README.md +6 -6
- data/tracks/java/exercises/diamond/src/test/java/DiamondPrinterTest.java +0 -3
- data/tracks/java/exercises/difference-of-squares/.meta/.version +1 -0
- data/tracks/java/exercises/difference-of-squares/src/test/java/DifferenceOfSquaresCalculatorTest.java +0 -3
- data/tracks/java/exercises/etl/README.md +2 -0
- data/tracks/java/exercises/flatten-array/.meta/.version +1 -0
- data/tracks/java/exercises/flatten-array/README.md +1 -2
- data/tracks/java/exercises/flatten-array/src/test/java/FlattenerTest.java +0 -3
- data/tracks/java/exercises/food-chain/README.md +1 -1
- data/tracks/java/exercises/forth/.meta/.version +1 -0
- data/tracks/java/exercises/forth/src/test/java/ForthEvaluatorTest.java +0 -3
- data/tracks/java/exercises/grade-school/README.md +0 -1
- data/tracks/java/exercises/hamming/.meta/.version +1 -0
- data/tracks/java/exercises/hamming/src/test/java/HammingTest.java +0 -3
- data/tracks/java/exercises/house/README.md +1 -2
- data/tracks/java/exercises/isogram/README.md +2 -1
- data/tracks/java/exercises/kindergarten-garden/README.md +13 -13
- data/tracks/java/exercises/linked-list/README.md +10 -10
- data/tracks/java/exercises/list-ops/.meta/.version +1 -0
- data/tracks/java/exercises/list-ops/README.md +4 -0
- data/tracks/java/exercises/list-ops/src/test/java/ListOpsTest.java +0 -3
- data/tracks/java/exercises/luhn/README.md +7 -7
- data/tracks/java/exercises/matrix/README.md +6 -4
- data/tracks/java/exercises/meetup/README.md +1 -2
- data/tracks/java/exercises/minesweeper/.meta/.version +1 -0
- data/tracks/java/exercises/minesweeper/src/test/java/MinesweeperBoardTest.java +0 -3
- data/tracks/java/exercises/nucleotide-count/README.md +8 -22
- data/tracks/java/exercises/ocr-numbers/README.md +5 -5
- data/tracks/java/exercises/octal/README.md +6 -2
- data/tracks/java/exercises/palindrome-products/README.md +15 -16
- data/tracks/java/exercises/pangram/.meta/.version +1 -0
- data/tracks/java/exercises/pangram/README.md +1 -1
- data/tracks/java/exercises/pangram/src/test/java/PangramCheckerTest.java +0 -3
- data/tracks/java/exercises/pascals-triangle/.meta/.version +1 -0
- data/tracks/java/exercises/pascals-triangle/README.md +1 -1
- data/tracks/java/exercises/pascals-triangle/src/test/java/PascalsTriangleGeneratorTest.java +0 -3
- data/tracks/java/exercises/perfect-numbers/.meta/.version +1 -0
- data/tracks/java/exercises/perfect-numbers/README.md +2 -2
- data/tracks/java/exercises/perfect-numbers/src/test/java/NaturalNumberTest.java +0 -3
- data/tracks/java/exercises/phone-number/README.md +3 -2
- data/tracks/java/exercises/pythagorean-triplet/README.md +3 -3
- data/tracks/java/exercises/queen-attack/README.md +1 -1
- data/tracks/java/exercises/rectangles/README.md +7 -7
- data/tracks/java/exercises/rna-transcription/.meta/.version +1 -0
- data/tracks/java/exercises/rna-transcription/src/test/java/RnaTranscriptionTest.java +0 -3
- data/tracks/java/exercises/roman-numerals/README.md +1 -1
- data/tracks/java/exercises/rotational-cipher/README.md +2 -1
- data/tracks/java/exercises/run-length-encoding/README.md +4 -4
- data/tracks/java/exercises/saddle-points/.meta/.version +1 -0
- data/tracks/java/exercises/saddle-points/README.md +1 -1
- data/tracks/java/exercises/saddle-points/src/test/java/MatrixTest.java +0 -3
- data/tracks/java/exercises/scrabble-score/.meta/.version +1 -0
- data/tracks/java/exercises/scrabble-score/README.md +3 -1
- data/tracks/java/exercises/scrabble-score/src/test/java/ScrabbleScoreTest.java +0 -3
- data/tracks/java/exercises/secret-handshake/README.md +1 -1
- data/tracks/java/exercises/simple-cipher/README.md +1 -1
- data/tracks/java/exercises/simple-linked-list/src/test/java/SimpleLinkedListTest.java +25 -25
- data/tracks/java/exercises/space-age/README.md +1 -1
- data/tracks/java/exercises/spiral-matrix/.meta/.version +1 -0
- data/tracks/java/exercises/spiral-matrix/README.md +2 -2
- data/tracks/java/exercises/spiral-matrix/src/test/java/SpiralMatrixBuilderTest.java +0 -3
- data/tracks/java/exercises/sum-of-multiples/README.md +0 -3
- data/tracks/java/exercises/tournament/README.md +6 -5
- data/tracks/java/exercises/transpose/README.md +7 -7
- data/tracks/java/exercises/triangle/README.md +9 -6
- data/tracks/java/exercises/trinary/README.md +1 -1
- data/tracks/java/exercises/twelve-days/README.md +1 -1
- data/tracks/java/exercises/two-fer/README.md +1 -2
- data/tracks/java/exercises/word-count/README.md +1 -2
- data/tracks/java/exercises/word-search/.meta/.version +1 -0
- data/tracks/java/exercises/word-search/README.md +1 -1
- data/tracks/java/exercises/word-search/src/test/java/WordSearcherTest.java +0 -3
- data/tracks/java/exercises/wordy/README.md +0 -5
- data/tracks/javascript/config.json +13 -0
- data/tracks/javascript/docs/TESTS.md +1 -1
- data/tracks/javascript/exercises/diffie-hellman/example.js +1 -1
- data/tracks/javascript/exercises/hello-world/example.js +2 -3
- data/tracks/javascript/exercises/meetup/example.js +24 -27
- data/tracks/javascript/exercises/meetup/meetup.spec.js +0 -6
- data/tracks/javascript/exercises/nucleotide-count/nucleotide-count.spec.js +1 -1
- data/tracks/javascript/exercises/protein-translation/README.md +73 -0
- data/tracks/javascript/exercises/protein-translation/example.js +68 -0
- data/tracks/javascript/exercises/protein-translation/protein-translation.spec.js +63 -0
- data/tracks/julia/README.md +1 -1
- data/tracks/kotlin/config.json +11 -0
- data/tracks/kotlin/exercises/acronym/README.md +0 -1
- data/tracks/kotlin/exercises/all-your-base/README.md +1 -1
- data/tracks/kotlin/exercises/allergies/README.md +0 -1
- data/tracks/kotlin/exercises/atbash-cipher/README.md +2 -1
- data/tracks/kotlin/exercises/beer-song/README.md +1 -1
- data/tracks/kotlin/exercises/binary/README.md +2 -0
- data/tracks/kotlin/exercises/change/README.md +1 -1
- data/tracks/kotlin/exercises/collatz-conjecture/README.md +1 -1
- data/tracks/kotlin/exercises/complex-numbers/README.md +27 -0
- data/tracks/kotlin/exercises/diamond/README.md +6 -6
- data/tracks/kotlin/exercises/etl/README.md +2 -0
- data/tracks/kotlin/exercises/flatten-array/README.md +1 -2
- data/tracks/kotlin/exercises/grade-school/README.md +0 -1
- data/tracks/kotlin/exercises/grains/README.md +0 -1
- data/tracks/kotlin/exercises/hello-world/.meta/hints.md +4 -0
- data/tracks/kotlin/exercises/hello-world/.meta/src/reference/kotlin/HelloWorld.kt +2 -2
- data/tracks/kotlin/exercises/hello-world/README.md +6 -0
- data/tracks/kotlin/exercises/hello-world/TUTORIAL.md +32 -434
- data/tracks/kotlin/exercises/hello-world/src/main/kotlin/HelloWorld.kt +1 -1
- data/tracks/kotlin/exercises/hello-world/src/test/kotlin/HelloWorldTest.kt +2 -21
- data/tracks/kotlin/exercises/isogram/README.md +2 -1
- data/tracks/kotlin/exercises/leap/README.md +1 -1
- data/tracks/kotlin/exercises/linked-list/README.md +10 -10
- data/tracks/kotlin/exercises/luhn/README.md +7 -7
- data/tracks/kotlin/exercises/meetup/README.md +1 -2
- data/tracks/kotlin/exercises/nucleotide-count/README.md +8 -22
- data/tracks/kotlin/exercises/pangram/README.md +1 -1
- data/tracks/kotlin/exercises/pascals-triangle/README.md +1 -1
- data/tracks/kotlin/exercises/perfect-numbers/README.md +2 -2
- data/tracks/kotlin/exercises/phone-number/README.md +3 -2
- data/tracks/kotlin/exercises/roman-numerals/README.md +1 -1
- data/tracks/kotlin/exercises/rotational-cipher/README.md +2 -1
- data/tracks/kotlin/exercises/saddle-points/README.md +1 -1
- data/tracks/kotlin/exercises/scrabble-score/README.md +3 -1
- data/tracks/kotlin/exercises/secret-handshake/README.md +1 -1
- data/tracks/kotlin/exercises/settings.gradle +1 -0
- data/tracks/kotlin/exercises/space-age/README.md +1 -2
- data/tracks/kotlin/exercises/spiral-matrix/README.md +2 -2
- data/tracks/kotlin/exercises/sum-of-multiples/README.md +0 -3
- data/tracks/kotlin/exercises/triangle/README.md +9 -6
- data/tracks/kotlin/exercises/two-fer/.meta/src/reference/kotlin/Twofer.kt +3 -0
- data/tracks/kotlin/exercises/two-fer/README.md +50 -0
- data/tracks/kotlin/exercises/two-fer/build.gradle +28 -0
- data/tracks/kotlin/exercises/two-fer/src/main/kotlin/.keep +0 -0
- data/tracks/kotlin/exercises/two-fer/src/test/kotlin/TwoferTest.kt +31 -0
- data/tracks/kotlin/exercises/word-count/README.md +1 -2
- data/tracks/ocaml/exercises/pangram/test.ml +3 -1
- data/tracks/perl5/.travis.yml +3 -1
- data/tracks/php/Makefile +2 -2
- data/tracks/php/README.md +4 -4
- data/tracks/php/config.json +15 -0
- data/tracks/php/exercises/transpose/example.php +30 -0
- data/tracks/php/exercises/transpose/transpose_test.php +116 -0
- data/tracks/php/{phpcs-xphp.xml → phpcs-php.xml} +0 -0
- data/tracks/python/.travis.yml +1 -1
- data/tracks/python/config.json +199 -39
- data/tracks/python/exercises/acronym/acronym_test.py +1 -1
- data/tracks/python/exercises/allergies/allergies_test.py +1 -1
- data/tracks/python/exercises/alphametics/alphametics_test.py +1 -1
- data/tracks/python/exercises/anagram/anagram_test.py +1 -1
- data/tracks/python/exercises/atbash-cipher/atbash_cipher_test.py +1 -1
- data/tracks/python/exercises/bob/bob.py +1 -1
- data/tracks/python/exercises/bob/bob_test.py +1 -1
- data/tracks/python/exercises/book-store/book_store_test.py +1 -1
- data/tracks/python/exercises/bracket-push/bracket_push.py +1 -1
- data/tracks/python/exercises/bracket-push/bracket_push_test.py +1 -1
- data/tracks/python/exercises/collatz-conjecture/collatz_conjecture_test.py +1 -1
- data/tracks/python/exercises/diamond/diamond_test.py +1 -1
- data/tracks/python/exercises/difference-of-squares/difference_of_squares_test.py +1 -1
- data/tracks/python/exercises/diffie-hellman/README.md +58 -0
- data/tracks/python/exercises/diffie-hellman/diffie_hellman.py +10 -0
- data/tracks/python/exercises/diffie-hellman/diffie_hellman_test.py +87 -0
- data/tracks/python/exercises/diffie-hellman/example.py +13 -0
- data/tracks/python/exercises/etl/etl_test.py +1 -1
- data/tracks/python/exercises/food-chain/README.md +81 -0
- data/tracks/python/exercises/food-chain/example.py +45 -0
- data/tracks/python/exercises/food-chain/food_chain.py +2 -0
- data/tracks/python/exercises/food-chain/food_chain_test.py +109 -0
- data/tracks/python/exercises/forth/README.md +43 -0
- data/tracks/python/exercises/forth/example.py +58 -0
- data/tracks/python/exercises/forth/forth.py +2 -0
- data/tracks/python/exercises/forth/forth_test.py +254 -0
- data/tracks/python/exercises/gigasecond/gigasecond_test.py +1 -1
- data/tracks/python/exercises/grep/grep_test.py +1 -1
- data/tracks/python/exercises/hello-world/hello_world_test.py +1 -1
- data/tracks/python/exercises/isogram/isogram_test.py +10 -10
- data/tracks/python/exercises/largest-series-product/largest_series_product_test.py +1 -1
- data/tracks/python/exercises/leap/leap_test.py +5 -5
- data/tracks/python/exercises/luhn/luhn_test.py +16 -16
- data/tracks/python/exercises/markdown/README.md +30 -0
- data/tracks/python/exercises/markdown/example.py +80 -0
- data/tracks/python/exercises/markdown/markdown.py +71 -0
- data/tracks/python/exercises/markdown/markdown_test.py +51 -0
- data/tracks/python/exercises/meetup/meetup_test.py +1 -1
- data/tracks/python/exercises/nth-prime/nth_prime_test.py +1 -1
- data/tracks/python/exercises/pascals-triangle/pascals_triangle_test.py +2 -2
- data/tracks/python/exercises/perfect-numbers/perfect_numbers_test.py +11 -11
- data/tracks/python/exercises/phone-number/phone_number_test.py +1 -1
- data/tracks/python/exercises/prime-factors/prime_factors_test.py +1 -1
- data/tracks/python/exercises/pythagorean-triplet/pythagorean_triplet_test.py +3 -3
- data/tracks/python/exercises/queen-attack/queen_attack_test.py +8 -8
- data/tracks/python/exercises/rail-fence-cipher/rail_fence_cipher_test.py +1 -1
- data/tracks/python/exercises/rectangles/rectangles_test.py +1 -1
- data/tracks/python/exercises/robot-simulator/robot_simulator.py +9 -1
- data/tracks/python/exercises/roman-numerals/roman_numerals_test.py +1 -1
- data/tracks/python/exercises/run-length-encoding/run_length_encoding_test.py +1 -1
- data/tracks/python/exercises/say/say_test.py +1 -1
- data/tracks/python/exercises/scrabble-score/scrabble_score_test.py +1 -1
- data/tracks/python/exercises/series/series.py +1 -1
- data/tracks/python/exercises/sieve/sieve_test.py +1 -1
- data/tracks/python/exercises/sublist/sublist_test.py +1 -1
- data/tracks/python/exercises/tournament/tournament_test.py +1 -1
- data/tracks/python/exercises/transpose/transpose_test.py +1 -1
- data/tracks/python/exercises/two-bucket/example.py +49 -54
- data/tracks/python/exercises/two-bucket/two_bucket_test.py +1 -1
- data/tracks/python/exercises/variable-length-quantity/variable_length_quantity_test.py +1 -1
- data/tracks/rust/config.json +24 -0
- data/tracks/rust/exercises/collatz-conjecture/Cargo.lock +4 -0
- data/tracks/rust/exercises/collatz-conjecture/Cargo.toml +3 -0
- data/tracks/rust/exercises/collatz-conjecture/README.md +65 -0
- data/tracks/rust/exercises/collatz-conjecture/example.rs +19 -0
- data/tracks/rust/exercises/collatz-conjecture/src/lib.rs +4 -0
- data/tracks/rust/exercises/collatz-conjecture/tests/collatz-conjecture.rs +32 -0
- data/tracks/rust/exercises/decimal/.gitignore +7 -0
- data/tracks/rust/exercises/decimal/.meta/description.md +19 -0
- data/tracks/rust/exercises/decimal/.meta/metadata.yml +3 -0
- data/tracks/rust/exercises/decimal/Cargo-example.toml +9 -0
- data/tracks/rust/exercises/decimal/Cargo.toml +6 -0
- data/tracks/rust/exercises/decimal/README.md +59 -0
- data/tracks/rust/exercises/decimal/example.rs +187 -0
- data/tracks/rust/exercises/decimal/src/lib.rs +10 -0
- data/tracks/rust/exercises/decimal/tests/decimal.rs +332 -0
- data/tracks/sml/exercises/accumulate/README.md +9 -1
- data/tracks/swift/exercises/luhn/Sources/LuhnExample.swift +17 -26
- data/tracks/swift/exercises/luhn/Tests/LinuxMain.swift +1 -1
- data/tracks/swift/exercises/luhn/Tests/LuhnTests/LuhnTests.swift +59 -35
- data/tracks/typescript/config.json +34 -0
- data/tracks/typescript/exercises/binary-search/README.md +67 -0
- data/tracks/typescript/exercises/binary-search/binary-search.example.ts +42 -0
- data/tracks/typescript/exercises/binary-search/binary-search.test.ts +27 -0
- data/tracks/typescript/exercises/binary-search/binary-search.ts +3 -0
- data/tracks/typescript/exercises/binary-search/package.json +36 -0
- data/tracks/typescript/exercises/binary-search/tsconfig.json +22 -0
- data/tracks/typescript/exercises/binary-search/tslint.json +127 -0
- data/tracks/typescript/exercises/binary-search/yarn.lock +2305 -0
- data/tracks/typescript/exercises/pascals-triangle/README.md +47 -0
- data/tracks/typescript/exercises/pascals-triangle/package.json +36 -0
- data/tracks/typescript/exercises/pascals-triangle/pascals-triangle.example.ts +32 -0
- data/tracks/typescript/exercises/pascals-triangle/pascals-triangle.test.ts +28 -0
- data/tracks/typescript/exercises/pascals-triangle/pascals-triangle.ts +2 -0
- data/tracks/typescript/exercises/pascals-triangle/tsconfig.json +22 -0
- data/tracks/typescript/exercises/pascals-triangle/tslint.json +127 -0
- data/tracks/typescript/exercises/pascals-triangle/yarn.lock +2305 -0
- data/tracks/typescript/exercises/rotational-cipher/README.md +63 -0
- data/tracks/typescript/exercises/rotational-cipher/package.json +36 -0
- data/tracks/typescript/exercises/rotational-cipher/rotational-cipher.example.ts +19 -0
- data/tracks/typescript/exercises/rotational-cipher/rotational-cipher.test.ts +56 -0
- data/tracks/typescript/exercises/rotational-cipher/rotational-cipher.ts +1 -0
- data/tracks/typescript/exercises/rotational-cipher/tsconfig.json +22 -0
- data/tracks/typescript/exercises/rotational-cipher/tslint.json +127 -0
- data/tracks/typescript/exercises/rotational-cipher/yarn.lock +2305 -0
- metadata +171 -5
- data/tracks/javascript/exercises/twelve-days/package.json +0 -69
- data/tracks/kotlin/exercises/hello-world/GETTING_STARTED.md +0 -50
|
@@ -3,118 +3,119 @@
|
|
|
3
3
|
|
|
4
4
|
void test_equilateral_is_true_if_all_sides_are_equal(void)
|
|
5
5
|
{
|
|
6
|
-
|
|
6
|
+
triangle_t sides = { 2, 2, 2 };
|
|
7
7
|
TEST_ASSERT_TRUE(is_equilateral(&sides));
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
void test_equilateral_is_false_if_any_side_is_unequal(void)
|
|
11
11
|
{
|
|
12
12
|
TEST_IGNORE(); // delete this line to run test
|
|
13
|
-
|
|
13
|
+
triangle_t sides = { 2, 3, 2 };
|
|
14
14
|
TEST_ASSERT_FALSE(is_equilateral(&sides));
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
void test_equilateral_is_false_if_all_sides_zero(void)
|
|
18
18
|
{
|
|
19
19
|
TEST_IGNORE();
|
|
20
|
-
|
|
20
|
+
triangle_t sides = { 0, 0, 0 };
|
|
21
21
|
TEST_ASSERT_FALSE(is_equilateral(&sides));
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
void test_equilateral_sides_may_be_floats(void)
|
|
25
25
|
{
|
|
26
26
|
TEST_IGNORE();
|
|
27
|
-
|
|
27
|
+
triangle_t sides = { 0.5, 0.5, 0.5 };
|
|
28
28
|
TEST_ASSERT_TRUE(is_equilateral(&sides));
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
void test_isosceles_is_true_if_last_two_sides_are_equal(void)
|
|
32
32
|
{
|
|
33
33
|
TEST_IGNORE();
|
|
34
|
-
|
|
34
|
+
triangle_t sides = { 3, 4, 4 };
|
|
35
35
|
TEST_ASSERT_TRUE(is_isosceles(&sides));
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
void test_isosceles_is_true_if_first_two_sides_are_equal(void)
|
|
39
39
|
{
|
|
40
40
|
TEST_IGNORE();
|
|
41
|
-
|
|
41
|
+
triangle_t sides = { 4, 4, 3 };
|
|
42
42
|
TEST_ASSERT_TRUE(is_isosceles(&sides));
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
void test_isosceles_is_true_if_first_and_last_sides_are_equal(void)
|
|
46
46
|
{
|
|
47
47
|
TEST_IGNORE();
|
|
48
|
-
|
|
48
|
+
triangle_t sides = { 4, 3, 4 };
|
|
49
49
|
TEST_ASSERT_TRUE(is_isosceles(&sides));
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
void test_equilateral_triangles_are_also_isosceles(void)
|
|
53
53
|
{
|
|
54
54
|
TEST_IGNORE();
|
|
55
|
-
|
|
55
|
+
triangle_t sides = { 4, 4, 4 };
|
|
56
56
|
TEST_ASSERT_TRUE(is_isosceles(&sides));
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
void test_isosceles_is_false_if_no_sides_are_equal(void)
|
|
60
60
|
{
|
|
61
61
|
TEST_IGNORE();
|
|
62
|
-
|
|
62
|
+
triangle_t sides = { 2, 3, 4 };
|
|
63
63
|
TEST_ASSERT_FALSE(is_isosceles(&sides));
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
void test_isosceles_is_false_if_two_sides_equal_and_violate_inequality(void)
|
|
67
67
|
{
|
|
68
68
|
TEST_IGNORE();
|
|
69
|
-
|
|
69
|
+
triangle_t sides = { 1, 1, 3 };
|
|
70
70
|
TEST_ASSERT_FALSE(is_isosceles(&sides));
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
void test_isosceles_sides_may_be_floats(void)
|
|
74
74
|
{
|
|
75
75
|
TEST_IGNORE();
|
|
76
|
-
|
|
76
|
+
triangle_t sides = { 0.5, 0.4, 0.5 };
|
|
77
77
|
TEST_ASSERT_TRUE(is_isosceles(&sides));
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
void test_scalene_is_true_if_no_sides_are_equal(void)
|
|
81
81
|
{
|
|
82
82
|
TEST_IGNORE();
|
|
83
|
-
|
|
83
|
+
triangle_t sides = { 5, 4, 6 };
|
|
84
84
|
TEST_ASSERT_TRUE(is_scalene(&sides));
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
void test_scalene_is_false_if_all_sides_are_equal(void)
|
|
88
88
|
{
|
|
89
89
|
TEST_IGNORE();
|
|
90
|
-
|
|
90
|
+
triangle_t sides = { 4, 4, 4 };
|
|
91
91
|
TEST_ASSERT_FALSE(is_scalene(&sides));
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
void test_scalene_is_false_if_two_sides_are_equal(void)
|
|
95
95
|
{
|
|
96
96
|
TEST_IGNORE();
|
|
97
|
-
|
|
97
|
+
triangle_t sides = { 4, 4, 3 };
|
|
98
98
|
TEST_ASSERT_FALSE(is_scalene(&sides));
|
|
99
99
|
}
|
|
100
100
|
|
|
101
101
|
void test_scalene_is_false_if_no_sides_equal_and_violate_inequality(void)
|
|
102
102
|
{
|
|
103
103
|
TEST_IGNORE();
|
|
104
|
-
|
|
104
|
+
triangle_t sides = { 7, 3, 2 };
|
|
105
105
|
TEST_ASSERT_FALSE(is_scalene(&sides));
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
void test_scalene_sides_may_be_floats(void)
|
|
109
109
|
{
|
|
110
110
|
TEST_IGNORE();
|
|
111
|
-
|
|
111
|
+
triangle_t sides = { 0.5, 0.4, 0.6 };
|
|
112
112
|
TEST_ASSERT_TRUE(is_scalene(&sides));
|
|
113
113
|
}
|
|
114
114
|
|
|
115
115
|
int main(void)
|
|
116
116
|
{
|
|
117
117
|
UnityBegin("test/test_triangle.c");
|
|
118
|
+
|
|
118
119
|
RUN_TEST(test_equilateral_is_true_if_all_sides_are_equal);
|
|
119
120
|
RUN_TEST(test_equilateral_is_false_if_any_side_is_unequal);
|
|
120
121
|
RUN_TEST(test_equilateral_is_false_if_all_sides_zero);
|
|
@@ -131,6 +132,7 @@ int main(void)
|
|
|
131
132
|
RUN_TEST(test_scalene_is_false_if_two_sides_are_equal);
|
|
132
133
|
RUN_TEST(test_scalene_is_false_if_no_sides_equal_and_violate_inequality);
|
|
133
134
|
RUN_TEST(test_scalene_sides_may_be_floats);
|
|
135
|
+
|
|
134
136
|
UnityEnd();
|
|
135
137
|
return 0;
|
|
136
138
|
}
|
|
@@ -7,59 +7,59 @@
|
|
|
7
7
|
// if word counted already it returns index,
|
|
8
8
|
// else returns -1
|
|
9
9
|
static int word_match(char *testWord, int current_word_count,
|
|
10
|
-
|
|
10
|
+
word_count_word_t words[MAX_WORDS])
|
|
11
11
|
{
|
|
12
|
-
int
|
|
12
|
+
int match_index = -1;
|
|
13
13
|
|
|
14
14
|
for (int index = 0; index < current_word_count; index++) {
|
|
15
15
|
if (!strcmp(testWord, words[index].text)) {
|
|
16
|
-
|
|
16
|
+
match_index = index;
|
|
17
17
|
break;
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
-
return
|
|
20
|
+
return match_index;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
int word_count(char *input_text,
|
|
23
|
+
int word_count(char *input_text, word_count_word_t words[MAX_WORDS])
|
|
24
24
|
{
|
|
25
25
|
int index;
|
|
26
|
-
int
|
|
27
|
-
char *
|
|
28
|
-
char *
|
|
26
|
+
int unique_words = 0;
|
|
27
|
+
char *test_word;
|
|
28
|
+
char *lower_case_input_text; // hold lowercase copy of passed text
|
|
29
29
|
const char *delimiters = " ,.-\n:!!&@$%^&\"";
|
|
30
30
|
|
|
31
31
|
// convert the input text to lower case
|
|
32
|
-
|
|
32
|
+
lower_case_input_text = malloc(strlen(input_text) + 1);
|
|
33
33
|
for (index = 0; input_text[index] != 0; index++) {
|
|
34
|
-
|
|
34
|
+
lower_case_input_text[index] = tolower(input_text[index]);
|
|
35
35
|
}
|
|
36
|
-
|
|
36
|
+
lower_case_input_text[index] = '\0';
|
|
37
37
|
|
|
38
38
|
// start with known results...
|
|
39
|
-
memset(words, 0, sizeof(
|
|
39
|
+
memset(words, 0, sizeof(word_count_word_t));
|
|
40
40
|
|
|
41
|
-
|
|
42
|
-
while (
|
|
41
|
+
test_word = strtok(lower_case_input_text, delimiters);
|
|
42
|
+
while (test_word != NULL) {
|
|
43
43
|
// account for leading/trailing single quote.
|
|
44
|
-
if (('\'' ==
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
if (('\'' == test_word[0]) && ('\'' == test_word[strlen(test_word) - 1])) {
|
|
45
|
+
test_word[strlen(test_word) - 1] = '\0';
|
|
46
|
+
test_word++;
|
|
47
47
|
}
|
|
48
48
|
// determine index of counted word.
|
|
49
|
-
index = word_match(
|
|
49
|
+
index = word_match(test_word, unique_words, words);
|
|
50
50
|
|
|
51
51
|
// add if not yet counted else increment count.
|
|
52
52
|
if (-1 == index) {
|
|
53
|
-
words[
|
|
54
|
-
strcpy(words[
|
|
55
|
-
|
|
53
|
+
words[unique_words].count = 1;
|
|
54
|
+
strcpy(words[unique_words].text, test_word);
|
|
55
|
+
unique_words++;
|
|
56
56
|
} else {
|
|
57
57
|
words[index].count++;
|
|
58
58
|
}
|
|
59
59
|
// get next word in string
|
|
60
|
-
|
|
60
|
+
test_word = strtok(NULL, delimiters);
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
free(
|
|
64
|
-
return
|
|
63
|
+
free(lower_case_input_text);
|
|
64
|
+
return unique_words;
|
|
65
65
|
}
|
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
#define MAX_WORD_LENGTH 50 // no individual word will exceed this length
|
|
6
6
|
|
|
7
7
|
// results structure
|
|
8
|
-
typedef struct
|
|
8
|
+
typedef struct word_count_word {
|
|
9
9
|
char text[MAX_WORD_LENGTH];
|
|
10
10
|
int count;
|
|
11
|
-
}
|
|
11
|
+
} word_count_word_t;
|
|
12
12
|
|
|
13
13
|
// word_count - routine to classify the unique words and their frequency in a test input string
|
|
14
14
|
// inputs:
|
|
@@ -17,6 +17,6 @@ typedef struct WordCount_Word {
|
|
|
17
17
|
//
|
|
18
18
|
// outputs:
|
|
19
19
|
// uniqueWords - number of words in the words structure
|
|
20
|
-
int word_count(char *input_text,
|
|
20
|
+
int word_count(char *input_text, word_count_word_t words[MAX_WORDS]);
|
|
21
21
|
|
|
22
22
|
#endif
|
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
#include "vendor/unity.h"
|
|
5
5
|
#include "../src/word_count.h"
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
word_count_word_t actual_solution[MAX_WORDS];
|
|
8
8
|
|
|
9
|
-
static void test_solution(
|
|
9
|
+
static void test_solution(word_count_word_t * expected_solution,
|
|
10
10
|
int expected_word_count,
|
|
11
|
-
|
|
11
|
+
word_count_word_t * actual_solution,
|
|
12
12
|
int actual_word_count)
|
|
13
13
|
{
|
|
14
14
|
// All words counted?
|
|
@@ -25,7 +25,7 @@ static void test_solution(WordCount_Word_t * expected_solution,
|
|
|
25
25
|
|
|
26
26
|
static void reset_actual_solution(void)
|
|
27
27
|
{
|
|
28
|
-
memset(
|
|
28
|
+
memset(actual_solution, 0, sizeof(actual_solution));
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
// Tests Start here
|
|
@@ -35,21 +35,21 @@ void test_word_count_one_word(void)
|
|
|
35
35
|
int actual_word_count;
|
|
36
36
|
char *input_text = "word";
|
|
37
37
|
const int expected_word_count = 1;
|
|
38
|
-
|
|
38
|
+
word_count_word_t expected_solution[expected_word_count];
|
|
39
39
|
|
|
40
40
|
// build the expected solution
|
|
41
|
-
memset(
|
|
41
|
+
memset(expected_solution, 0, sizeof(expected_solution)); // clear to start with a known value
|
|
42
42
|
|
|
43
43
|
// fill in the expected words
|
|
44
|
-
|
|
45
|
-
strncpy(
|
|
44
|
+
expected_solution[index].count = 1;
|
|
45
|
+
strncpy(expected_solution[index++].text, "word", MAX_WORD_LENGTH);
|
|
46
46
|
|
|
47
47
|
reset_actual_solution();
|
|
48
48
|
|
|
49
|
-
actual_word_count = word_count(input_text,
|
|
49
|
+
actual_word_count = word_count(input_text, actual_solution);
|
|
50
50
|
|
|
51
|
-
test_solution(
|
|
52
|
-
expected_word_count,
|
|
51
|
+
test_solution(expected_solution,
|
|
52
|
+
expected_word_count, actual_solution, actual_word_count);
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
void test_word_count_one_of_each_word(void)
|
|
@@ -59,26 +59,26 @@ void test_word_count_one_of_each_word(void)
|
|
|
59
59
|
int actual_word_count;
|
|
60
60
|
char *input_text = "one of each";
|
|
61
61
|
const int expected_word_count = 3;
|
|
62
|
-
|
|
62
|
+
word_count_word_t expected_solution[expected_word_count];
|
|
63
63
|
|
|
64
64
|
// build the expected solution
|
|
65
|
-
memset(
|
|
65
|
+
memset(expected_solution, 0, sizeof(expected_solution)); // clear to start with a known value
|
|
66
66
|
|
|
67
67
|
// fill in the expected words
|
|
68
|
-
|
|
69
|
-
strncpy(
|
|
68
|
+
expected_solution[index].count = 1;
|
|
69
|
+
strncpy(expected_solution[index++].text, "one", MAX_WORD_LENGTH);
|
|
70
70
|
|
|
71
|
-
|
|
72
|
-
strncpy(
|
|
71
|
+
expected_solution[index].count = 1;
|
|
72
|
+
strncpy(expected_solution[index++].text, "of", MAX_WORD_LENGTH);
|
|
73
73
|
|
|
74
|
-
|
|
75
|
-
strncpy(
|
|
74
|
+
expected_solution[index].count = 1;
|
|
75
|
+
strncpy(expected_solution[index++].text, "each", MAX_WORD_LENGTH);
|
|
76
76
|
|
|
77
77
|
reset_actual_solution();
|
|
78
|
-
actual_word_count = word_count(input_text,
|
|
78
|
+
actual_word_count = word_count(input_text, actual_solution);
|
|
79
79
|
|
|
80
|
-
test_solution(
|
|
81
|
-
expected_word_count,
|
|
80
|
+
test_solution(expected_solution,
|
|
81
|
+
expected_word_count, actual_solution, actual_word_count);
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
void test_word_count_multiple_occurrences_of_a_word(void)
|
|
@@ -88,31 +88,31 @@ void test_word_count_multiple_occurrences_of_a_word(void)
|
|
|
88
88
|
int actual_word_count;
|
|
89
89
|
char *input_text = "one fish two fish red fish blue fish";
|
|
90
90
|
const int expected_word_count = 5;
|
|
91
|
-
|
|
91
|
+
word_count_word_t expected_solution[expected_word_count];
|
|
92
92
|
|
|
93
93
|
// build the expected solution
|
|
94
|
-
memset(
|
|
94
|
+
memset(expected_solution, 0, sizeof(expected_solution)); // clear to start with a known value
|
|
95
95
|
|
|
96
|
-
|
|
97
|
-
strncpy(
|
|
96
|
+
expected_solution[index].count = 1;
|
|
97
|
+
strncpy(expected_solution[index++].text, "one", MAX_WORD_LENGTH);
|
|
98
98
|
|
|
99
|
-
|
|
100
|
-
strncpy(
|
|
99
|
+
expected_solution[index].count = 4;
|
|
100
|
+
strncpy(expected_solution[index++].text, "fish", MAX_WORD_LENGTH);
|
|
101
101
|
|
|
102
|
-
|
|
103
|
-
strncpy(
|
|
102
|
+
expected_solution[index].count = 1;
|
|
103
|
+
strncpy(expected_solution[index++].text, "two", MAX_WORD_LENGTH);
|
|
104
104
|
|
|
105
|
-
|
|
106
|
-
strncpy(
|
|
105
|
+
expected_solution[index].count = 1;
|
|
106
|
+
strncpy(expected_solution[index++].text, "red", MAX_WORD_LENGTH);
|
|
107
107
|
|
|
108
|
-
|
|
109
|
-
strncpy(
|
|
108
|
+
expected_solution[index].count = 1;
|
|
109
|
+
strncpy(expected_solution[index++].text, "blue", MAX_WORD_LENGTH);
|
|
110
110
|
|
|
111
111
|
reset_actual_solution();
|
|
112
|
-
actual_word_count = word_count(input_text,
|
|
112
|
+
actual_word_count = word_count(input_text, actual_solution);
|
|
113
113
|
|
|
114
|
-
test_solution(
|
|
115
|
-
expected_word_count,
|
|
114
|
+
test_solution(expected_solution,
|
|
115
|
+
expected_word_count, actual_solution, actual_word_count);
|
|
116
116
|
}
|
|
117
117
|
|
|
118
118
|
void test_word_count_handles_cramped_lists(void)
|
|
@@ -122,25 +122,25 @@ void test_word_count_handles_cramped_lists(void)
|
|
|
122
122
|
int actual_word_count;
|
|
123
123
|
char *input_text = "one,two,three";
|
|
124
124
|
const int expected_word_count = 3;
|
|
125
|
-
|
|
125
|
+
word_count_word_t expected_solution[expected_word_count];
|
|
126
126
|
|
|
127
127
|
// build the expected solution
|
|
128
|
-
memset(
|
|
128
|
+
memset(expected_solution, 0, sizeof(expected_solution)); // clear to start with a known value
|
|
129
129
|
|
|
130
|
-
|
|
131
|
-
strncpy(
|
|
130
|
+
expected_solution[index].count = 1;
|
|
131
|
+
strncpy(expected_solution[index++].text, "one", MAX_WORD_LENGTH);
|
|
132
132
|
|
|
133
|
-
|
|
134
|
-
strncpy(
|
|
133
|
+
expected_solution[index].count = 1;
|
|
134
|
+
strncpy(expected_solution[index++].text, "two", MAX_WORD_LENGTH);
|
|
135
135
|
|
|
136
|
-
|
|
137
|
-
strncpy(
|
|
136
|
+
expected_solution[index].count = 1;
|
|
137
|
+
strncpy(expected_solution[index++].text, "three", MAX_WORD_LENGTH);
|
|
138
138
|
|
|
139
139
|
reset_actual_solution();
|
|
140
|
-
actual_word_count = word_count(input_text,
|
|
140
|
+
actual_word_count = word_count(input_text, actual_solution);
|
|
141
141
|
|
|
142
|
-
test_solution(
|
|
143
|
-
expected_word_count,
|
|
142
|
+
test_solution(expected_solution,
|
|
143
|
+
expected_word_count, actual_solution, actual_word_count);
|
|
144
144
|
}
|
|
145
145
|
|
|
146
146
|
void test_word_count_handles_expanded_lists(void)
|
|
@@ -150,25 +150,25 @@ void test_word_count_handles_expanded_lists(void)
|
|
|
150
150
|
int actual_word_count;
|
|
151
151
|
char *input_text = "one,\ntwo,\nthree";
|
|
152
152
|
const int expected_word_count = 3;
|
|
153
|
-
|
|
153
|
+
word_count_word_t expected_solution[expected_word_count];
|
|
154
154
|
|
|
155
155
|
// build the expected solution
|
|
156
|
-
memset(
|
|
156
|
+
memset(expected_solution, 0, sizeof(expected_solution)); // clear to start with a known value
|
|
157
157
|
|
|
158
|
-
|
|
159
|
-
strncpy(
|
|
158
|
+
expected_solution[index].count = 1;
|
|
159
|
+
strncpy(expected_solution[index++].text, "one", MAX_WORD_LENGTH);
|
|
160
160
|
|
|
161
|
-
|
|
162
|
-
strncpy(
|
|
161
|
+
expected_solution[index].count = 1;
|
|
162
|
+
strncpy(expected_solution[index++].text, "two", MAX_WORD_LENGTH);
|
|
163
163
|
|
|
164
|
-
|
|
165
|
-
strncpy(
|
|
164
|
+
expected_solution[index].count = 1;
|
|
165
|
+
strncpy(expected_solution[index++].text, "three", MAX_WORD_LENGTH);
|
|
166
166
|
|
|
167
167
|
reset_actual_solution();
|
|
168
|
-
actual_word_count = word_count(input_text,
|
|
168
|
+
actual_word_count = word_count(input_text, actual_solution);
|
|
169
169
|
|
|
170
|
-
test_solution(
|
|
171
|
-
expected_word_count,
|
|
170
|
+
test_solution(expected_solution,
|
|
171
|
+
expected_word_count, actual_solution, actual_word_count);
|
|
172
172
|
}
|
|
173
173
|
|
|
174
174
|
void test_word_count_ignore_punctuation(void)
|
|
@@ -178,31 +178,31 @@ void test_word_count_ignore_punctuation(void)
|
|
|
178
178
|
int actual_word_count;
|
|
179
179
|
char *input_text = "car: carpet as java: javascript!!&@$%^&";
|
|
180
180
|
const int expected_word_count = 5;
|
|
181
|
-
|
|
181
|
+
word_count_word_t expected_solution[expected_word_count];
|
|
182
182
|
|
|
183
183
|
// build the expected solution
|
|
184
|
-
memset(
|
|
184
|
+
memset(expected_solution, 0, sizeof(expected_solution)); // clear to start with a known value
|
|
185
185
|
|
|
186
|
-
|
|
187
|
-
strncpy(
|
|
186
|
+
expected_solution[index].count = 1;
|
|
187
|
+
strncpy(expected_solution[index++].text, "car", MAX_WORD_LENGTH);
|
|
188
188
|
|
|
189
|
-
|
|
190
|
-
strncpy(
|
|
189
|
+
expected_solution[index].count = 1;
|
|
190
|
+
strncpy(expected_solution[index++].text, "carpet", MAX_WORD_LENGTH);
|
|
191
191
|
|
|
192
|
-
|
|
193
|
-
strncpy(
|
|
192
|
+
expected_solution[index].count = 1;
|
|
193
|
+
strncpy(expected_solution[index++].text, "as", MAX_WORD_LENGTH);
|
|
194
194
|
|
|
195
|
-
|
|
196
|
-
strncpy(
|
|
195
|
+
expected_solution[index].count = 1;
|
|
196
|
+
strncpy(expected_solution[index++].text, "java", MAX_WORD_LENGTH);
|
|
197
197
|
|
|
198
|
-
|
|
199
|
-
strncpy(
|
|
198
|
+
expected_solution[index].count = 1;
|
|
199
|
+
strncpy(expected_solution[index++].text, "javascript", MAX_WORD_LENGTH);
|
|
200
200
|
|
|
201
201
|
reset_actual_solution();
|
|
202
|
-
actual_word_count = word_count(input_text,
|
|
202
|
+
actual_word_count = word_count(input_text, actual_solution);
|
|
203
203
|
|
|
204
|
-
test_solution(
|
|
205
|
-
expected_word_count,
|
|
204
|
+
test_solution(expected_solution,
|
|
205
|
+
expected_word_count, actual_solution, actual_word_count);
|
|
206
206
|
}
|
|
207
207
|
|
|
208
208
|
void test_word_count_include_numbers(void)
|
|
@@ -212,25 +212,25 @@ void test_word_count_include_numbers(void)
|
|
|
212
212
|
int actual_word_count;
|
|
213
213
|
char *input_text = "testing, 1, 2 testing";
|
|
214
214
|
const int expected_word_count = 3;
|
|
215
|
-
|
|
215
|
+
word_count_word_t expected_solution[expected_word_count];
|
|
216
216
|
|
|
217
217
|
// build the expected solution
|
|
218
|
-
memset(
|
|
218
|
+
memset(expected_solution, 0, sizeof(expected_solution)); // clear to start with a known value
|
|
219
219
|
|
|
220
|
-
|
|
221
|
-
strncpy(
|
|
220
|
+
expected_solution[index].count = 2;
|
|
221
|
+
strncpy(expected_solution[index++].text, "testing", MAX_WORD_LENGTH);
|
|
222
222
|
|
|
223
|
-
|
|
224
|
-
strncpy(
|
|
223
|
+
expected_solution[index].count = 1;
|
|
224
|
+
strncpy(expected_solution[index++].text, "1", MAX_WORD_LENGTH);
|
|
225
225
|
|
|
226
|
-
|
|
227
|
-
strncpy(
|
|
226
|
+
expected_solution[index].count = 1;
|
|
227
|
+
strncpy(expected_solution[index++].text, "2", MAX_WORD_LENGTH);
|
|
228
228
|
|
|
229
229
|
reset_actual_solution();
|
|
230
|
-
actual_word_count = word_count(input_text,
|
|
230
|
+
actual_word_count = word_count(input_text, actual_solution);
|
|
231
231
|
|
|
232
|
-
test_solution(
|
|
233
|
-
expected_word_count,
|
|
232
|
+
test_solution(expected_solution,
|
|
233
|
+
expected_word_count, actual_solution, actual_word_count);
|
|
234
234
|
}
|
|
235
235
|
|
|
236
236
|
void test_word_count_normalize_case(void)
|
|
@@ -240,22 +240,22 @@ void test_word_count_normalize_case(void)
|
|
|
240
240
|
int actual_word_count;
|
|
241
241
|
char *input_text = "go Go GO Stop stop";
|
|
242
242
|
const int expected_word_count = 2;
|
|
243
|
-
|
|
243
|
+
word_count_word_t expected_solution[expected_word_count];
|
|
244
244
|
|
|
245
245
|
// build the expected solution
|
|
246
|
-
memset(
|
|
246
|
+
memset(expected_solution, 0, sizeof(expected_solution)); // clear to start with a known value
|
|
247
247
|
|
|
248
|
-
|
|
249
|
-
strncpy(
|
|
248
|
+
expected_solution[index].count = 3;
|
|
249
|
+
strncpy(expected_solution[index++].text, "go", MAX_WORD_LENGTH);
|
|
250
250
|
|
|
251
|
-
|
|
252
|
-
strncpy(
|
|
251
|
+
expected_solution[index].count = 2;
|
|
252
|
+
strncpy(expected_solution[index++].text, "stop", MAX_WORD_LENGTH);
|
|
253
253
|
|
|
254
254
|
reset_actual_solution();
|
|
255
|
-
actual_word_count = word_count(input_text,
|
|
255
|
+
actual_word_count = word_count(input_text, actual_solution);
|
|
256
256
|
|
|
257
|
-
test_solution(
|
|
258
|
-
expected_word_count,
|
|
257
|
+
test_solution(expected_solution,
|
|
258
|
+
expected_word_count, actual_solution, actual_word_count);
|
|
259
259
|
}
|
|
260
260
|
|
|
261
261
|
void test_word_count_with_apostrophes(void)
|
|
@@ -265,31 +265,31 @@ void test_word_count_with_apostrophes(void)
|
|
|
265
265
|
int actual_word_count;
|
|
266
266
|
char *input_text = "First: don't laugh. Then: don't cry.";
|
|
267
267
|
const int expected_word_count = 5;
|
|
268
|
-
|
|
268
|
+
word_count_word_t expected_solution[expected_word_count];
|
|
269
269
|
|
|
270
270
|
// build the expected solution
|
|
271
|
-
memset(
|
|
271
|
+
memset(expected_solution, 0, sizeof(expected_solution)); // clear to start with a known value
|
|
272
272
|
|
|
273
|
-
|
|
274
|
-
strncpy(
|
|
273
|
+
expected_solution[index].count = 1;
|
|
274
|
+
strncpy(expected_solution[index++].text, "first", MAX_WORD_LENGTH);
|
|
275
275
|
|
|
276
|
-
|
|
277
|
-
strncpy(
|
|
276
|
+
expected_solution[index].count = 2;
|
|
277
|
+
strncpy(expected_solution[index++].text, "don't", MAX_WORD_LENGTH);
|
|
278
278
|
|
|
279
|
-
|
|
280
|
-
strncpy(
|
|
279
|
+
expected_solution[index].count = 1;
|
|
280
|
+
strncpy(expected_solution[index++].text, "laugh", MAX_WORD_LENGTH);
|
|
281
281
|
|
|
282
|
-
|
|
283
|
-
strncpy(
|
|
282
|
+
expected_solution[index].count = 1;
|
|
283
|
+
strncpy(expected_solution[index++].text, "then", MAX_WORD_LENGTH);
|
|
284
284
|
|
|
285
|
-
|
|
286
|
-
strncpy(
|
|
285
|
+
expected_solution[index].count = 1;
|
|
286
|
+
strncpy(expected_solution[index++].text, "cry", MAX_WORD_LENGTH);
|
|
287
287
|
|
|
288
288
|
reset_actual_solution();
|
|
289
|
-
actual_word_count = word_count(input_text,
|
|
289
|
+
actual_word_count = word_count(input_text, actual_solution);
|
|
290
290
|
|
|
291
|
-
test_solution(
|
|
292
|
-
expected_word_count,
|
|
291
|
+
test_solution(expected_solution,
|
|
292
|
+
expected_word_count, actual_solution, actual_word_count);
|
|
293
293
|
}
|
|
294
294
|
|
|
295
295
|
void test_word_count_with_quotation(void)
|
|
@@ -299,34 +299,34 @@ void test_word_count_with_quotation(void)
|
|
|
299
299
|
int actual_word_count;
|
|
300
300
|
char *input_text = "Joe can't tell between 'large' and large.";
|
|
301
301
|
const int expected_word_count = 6;
|
|
302
|
-
|
|
302
|
+
word_count_word_t expected_solution[expected_word_count];
|
|
303
303
|
|
|
304
304
|
// build the expected solution
|
|
305
|
-
memset(
|
|
305
|
+
memset(expected_solution, 0, sizeof(expected_solution)); // clear to start with a known value
|
|
306
306
|
|
|
307
|
-
|
|
308
|
-
strncpy(
|
|
307
|
+
expected_solution[index].count = 1;
|
|
308
|
+
strncpy(expected_solution[index++].text, "joe", MAX_WORD_LENGTH);
|
|
309
309
|
|
|
310
|
-
|
|
311
|
-
strncpy(
|
|
310
|
+
expected_solution[index].count = 1;
|
|
311
|
+
strncpy(expected_solution[index++].text, "can't", MAX_WORD_LENGTH);
|
|
312
312
|
|
|
313
|
-
|
|
314
|
-
strncpy(
|
|
313
|
+
expected_solution[index].count = 1;
|
|
314
|
+
strncpy(expected_solution[index++].text, "tell", MAX_WORD_LENGTH);
|
|
315
315
|
|
|
316
|
-
|
|
317
|
-
strncpy(
|
|
316
|
+
expected_solution[index].count = 1;
|
|
317
|
+
strncpy(expected_solution[index++].text, "between", MAX_WORD_LENGTH);
|
|
318
318
|
|
|
319
|
-
|
|
320
|
-
strncpy(
|
|
319
|
+
expected_solution[index].count = 2;
|
|
320
|
+
strncpy(expected_solution[index++].text, "large", MAX_WORD_LENGTH);
|
|
321
321
|
|
|
322
|
-
|
|
323
|
-
strncpy(
|
|
322
|
+
expected_solution[index].count = 1;
|
|
323
|
+
strncpy(expected_solution[index++].text, "and", MAX_WORD_LENGTH);
|
|
324
324
|
|
|
325
325
|
reset_actual_solution();
|
|
326
|
-
actual_word_count = word_count(input_text,
|
|
326
|
+
actual_word_count = word_count(input_text, actual_solution);
|
|
327
327
|
|
|
328
|
-
test_solution(
|
|
329
|
-
expected_word_count,
|
|
328
|
+
test_solution(expected_solution,
|
|
329
|
+
expected_word_count, actual_solution, actual_word_count);
|
|
330
330
|
}
|
|
331
331
|
|
|
332
332
|
void test_word_count_from_example(void)
|
|
@@ -336,28 +336,28 @@ void test_word_count_from_example(void)
|
|
|
336
336
|
int actual_word_count;
|
|
337
337
|
char *input_text = "olly olly in come free";
|
|
338
338
|
const int expected_word_count = 4;
|
|
339
|
-
|
|
339
|
+
word_count_word_t expected_solution[expected_word_count];
|
|
340
340
|
|
|
341
341
|
// build the expected solution
|
|
342
|
-
memset(
|
|
342
|
+
memset(expected_solution, 0, sizeof(expected_solution)); // clear to start with a known value
|
|
343
343
|
|
|
344
|
-
|
|
345
|
-
strncpy(
|
|
344
|
+
expected_solution[index].count = 2;
|
|
345
|
+
strncpy(expected_solution[index++].text, "olly", MAX_WORD_LENGTH);
|
|
346
346
|
|
|
347
|
-
|
|
348
|
-
strncpy(
|
|
347
|
+
expected_solution[index].count = 1;
|
|
348
|
+
strncpy(expected_solution[index++].text, "in", MAX_WORD_LENGTH);
|
|
349
349
|
|
|
350
|
-
|
|
351
|
-
strncpy(
|
|
350
|
+
expected_solution[index].count = 1;
|
|
351
|
+
strncpy(expected_solution[index++].text, "come", MAX_WORD_LENGTH);
|
|
352
352
|
|
|
353
|
-
|
|
354
|
-
strncpy(
|
|
353
|
+
expected_solution[index].count = 1;
|
|
354
|
+
strncpy(expected_solution[index++].text, "free", MAX_WORD_LENGTH);
|
|
355
355
|
|
|
356
356
|
reset_actual_solution();
|
|
357
|
-
actual_word_count = word_count(input_text,
|
|
357
|
+
actual_word_count = word_count(input_text, actual_solution);
|
|
358
358
|
|
|
359
|
-
test_solution(
|
|
360
|
-
expected_word_count,
|
|
359
|
+
test_solution(expected_solution,
|
|
360
|
+
expected_word_count, actual_solution, actual_word_count);
|
|
361
361
|
}
|
|
362
362
|
|
|
363
363
|
int main(void)
|