From 8a1c752045ef18dc45fcad610ae6fab513e3bc0d Mon Sep 17 00:00:00 2001 From: richard Date: Tue, 24 Apr 2018 07:19:17 -0400 Subject: [PATCH] finished default parser --- composer.json | 2 +- src/Application/UseCases/MergeCollections.php | 15 + .../Modules/Interpreter/Lexicon/Author.php | 40 + .../Modules/Interpreter/Lexicon/Book.php | 40 + .../Interpreter/Lexicon/Discography.php | 40 + .../Modules/Interpreter/Lexicon/EndOfTune.php | 53 ++ .../Modules/Interpreter/Lexicon/Filename.php | 42 ++ .../Modules/Interpreter/Lexicon/Group.php | 40 + .../Modules/Interpreter/Lexicon/History.php | 62 ++ .../Interpreter/Lexicon/KeySignature.php | 41 ++ .../Modules/Interpreter/Lexicon/Meter.php | 42 ++ .../Modules/Interpreter/Lexicon/MusicLine.php | 43 ++ .../Interpreter/Lexicon/NoteLength.php | 40 + .../Modules/Interpreter/Lexicon/Notes.php | 40 + .../Modules/Interpreter/Lexicon/Origin.php | 40 + .../Modules/Interpreter/Lexicon/Parts.php | 42 ++ .../Modules/Interpreter/Lexicon/Rhythm.php | 42 ++ .../Modules/Interpreter/Lexicon/Source.php | 42 ++ .../Modules/Interpreter/Lexicon/Tempo.php | 40 + .../Interpreter/Lexicon/Transcriber.php | 40 + .../Modules/Interpreter/Lexicon/Words.php | 40 + tests/_data/abc/jigs.abc | 684 ++++++++++++++++++ .../_support/_generated/UnitTesterActions.php | 6 +- .../Domain/Atoms/UnsignedIntegerAtomTest.php | 50 ++ .../unit/AbcParser/Domain/Core/PersonTest.php | 26 + tests/unit/AbcParser/Domain/Core/TuneTest.php | 171 +++++ 26 files changed, 1757 insertions(+), 6 deletions(-) create mode 100644 src/Application/UseCases/MergeCollections.php create mode 100644 src/Domain/Modules/Interpreter/Lexicon/Author.php create mode 100644 src/Domain/Modules/Interpreter/Lexicon/Book.php create mode 100644 src/Domain/Modules/Interpreter/Lexicon/Discography.php create mode 100644 src/Domain/Modules/Interpreter/Lexicon/EndOfTune.php create mode 100644 src/Domain/Modules/Interpreter/Lexicon/Filename.php create mode 100644 src/Domain/Modules/Interpreter/Lexicon/Group.php create mode 100644 src/Domain/Modules/Interpreter/Lexicon/History.php create mode 100644 src/Domain/Modules/Interpreter/Lexicon/KeySignature.php create mode 100644 src/Domain/Modules/Interpreter/Lexicon/Meter.php create mode 100644 src/Domain/Modules/Interpreter/Lexicon/MusicLine.php create mode 100644 src/Domain/Modules/Interpreter/Lexicon/NoteLength.php create mode 100644 src/Domain/Modules/Interpreter/Lexicon/Notes.php create mode 100644 src/Domain/Modules/Interpreter/Lexicon/Origin.php create mode 100644 src/Domain/Modules/Interpreter/Lexicon/Parts.php create mode 100644 src/Domain/Modules/Interpreter/Lexicon/Rhythm.php create mode 100644 src/Domain/Modules/Interpreter/Lexicon/Source.php create mode 100644 src/Domain/Modules/Interpreter/Lexicon/Tempo.php create mode 100644 src/Domain/Modules/Interpreter/Lexicon/Transcriber.php create mode 100644 src/Domain/Modules/Interpreter/Lexicon/Words.php create mode 100644 tests/_data/abc/jigs.abc create mode 100644 tests/unit/AbcParser/Domain/Atoms/UnsignedIntegerAtomTest.php create mode 100644 tests/unit/AbcParser/Domain/Core/PersonTest.php create mode 100644 tests/unit/AbcParser/Domain/Core/TuneTest.php diff --git a/composer.json b/composer.json index 0c0a426..9e6b72e 100644 --- a/composer.json +++ b/composer.json @@ -10,7 +10,7 @@ } ], "require": { - "codeception/codeception": "^2.2", + "codeception/codeception": "^2.4", "zackkitzmiller/tiny": "^1.2", "webpatser/laravel-uuid": "^2.0", "enzyme/axiom": "^4.2", diff --git a/src/Application/UseCases/MergeCollections.php b/src/Application/UseCases/MergeCollections.php new file mode 100644 index 0000000..74187a1 --- /dev/null +++ b/src/Application/UseCases/MergeCollections.php @@ -0,0 +1,15 @@ +merge($additions); + } +} diff --git a/src/Domain/Modules/Interpreter/Lexicon/Author.php b/src/Domain/Modules/Interpreter/Lexicon/Author.php new file mode 100644 index 0000000..36f07be --- /dev/null +++ b/src/Domain/Modules/Interpreter/Lexicon/Author.php @@ -0,0 +1,40 @@ +builder = $builder; + } + + /** + * @param Context $context + * @param \Closure $next + * @return mixed + * @throws \Enzyme\Axiom\Exceptions\AtomException + */ + public function handle(Context $context, \Closure $next) + { + $line = $context->current(); + list($key, $data) = $this->getKeyDataFromLine($line); + + if ($key === 'A') { + $this->builder->addAuthor(new StringAtom($data)); + } + + return $next($context); + } +} diff --git a/src/Domain/Modules/Interpreter/Lexicon/Book.php b/src/Domain/Modules/Interpreter/Lexicon/Book.php new file mode 100644 index 0000000..17c4128 --- /dev/null +++ b/src/Domain/Modules/Interpreter/Lexicon/Book.php @@ -0,0 +1,40 @@ +builder = $builder; + } + + /** + * @param Context $context + * @param \Closure $next + * @return mixed + * @throws \Enzyme\Axiom\Exceptions\AtomException + */ + public function handle(Context $context, \Closure $next) + { + $line = $context->current(); + list($key, $data) = $this->getKeyDataFromLine($line); + + if ($key === 'B') { + $this->builder->addBook(new StringAtom($data)); + } + + return $next($context); + } +} diff --git a/src/Domain/Modules/Interpreter/Lexicon/Discography.php b/src/Domain/Modules/Interpreter/Lexicon/Discography.php new file mode 100644 index 0000000..bd1655d --- /dev/null +++ b/src/Domain/Modules/Interpreter/Lexicon/Discography.php @@ -0,0 +1,40 @@ +builder = $builder; + } + + /** + * @param Context $context + * @param \Closure $next + * @return mixed + * @throws \Enzyme\Axiom\Exceptions\AtomException + */ + public function handle(Context $context, \Closure $next) + { + $line = $context->current(); + list($key, $data) = $this->getKeyDataFromLine($line); + + if ($key === 'D') { + $this->builder->addDiscography(new StringAtom($data)); + } + + return $next($context); + } +} diff --git a/src/Domain/Modules/Interpreter/Lexicon/EndOfTune.php b/src/Domain/Modules/Interpreter/Lexicon/EndOfTune.php new file mode 100644 index 0000000..7c83550 --- /dev/null +++ b/src/Domain/Modules/Interpreter/Lexicon/EndOfTune.php @@ -0,0 +1,53 @@ +builder = $builder; + } + + /** + * @param Context $context + * @param \Closure $next + * @return mixed + * @throws \Enzyme\Axiom\Exceptions\AtomException + */ + public function handle(Context $context, \Closure $next) + { + $line = $context->current(); +// list($key, $data) = $this->getKeyDataFromLine($line); + + if ($this->isEndOfFile($context) || $this->isEndOfMusic($context, $line)) { + $this->builder->handleEndOfMusic(); + } + + return $next($context); + } + + protected function isEndOfFile(Context $context) + { + $key = $context->key(); + return $context->count() <= $key+1; + } + + private function isEndOfMusic(Context $context, string $line) + { + return $context->isState(Context::MODE_TUNE_BODY) + && preg_match('/^\s*$/', $line); + } + +} diff --git a/src/Domain/Modules/Interpreter/Lexicon/Filename.php b/src/Domain/Modules/Interpreter/Lexicon/Filename.php new file mode 100644 index 0000000..77f0923 --- /dev/null +++ b/src/Domain/Modules/Interpreter/Lexicon/Filename.php @@ -0,0 +1,42 @@ +builder = $builder; + } + + /** + * @param Context $context + * @param \Closure $next + * @return mixed + * @throws \Enzyme\Axiom\Exceptions\AtomException + */ + public function handle(Context $context, \Closure $next) + { + $line = $context->current(); + list($key, $data) = $this->getKeyDataFromLine($line); + + if ($key === 'F' + && $context->getState() === $context::MODE_TUNE_HEADER + ) { + $this->builder->addFilename(new StringAtom($data)); + } + + return $next($context); + } +} diff --git a/src/Domain/Modules/Interpreter/Lexicon/Group.php b/src/Domain/Modules/Interpreter/Lexicon/Group.php new file mode 100644 index 0000000..73b3a2c --- /dev/null +++ b/src/Domain/Modules/Interpreter/Lexicon/Group.php @@ -0,0 +1,40 @@ +builder = $builder; + } + + /** + * @param Context $context + * @param \Closure $next + * @return mixed + * @throws \Enzyme\Axiom\Exceptions\AtomException + */ + public function handle(Context $context, \Closure $next) + { + $line = $context->current(); + list($key, $data) = $this->getKeyDataFromLine($line); + + if ($key === 'G') { + $this->builder->addGroup(new StringAtom($data)); + } + + return $next($context); + } +} diff --git a/src/Domain/Modules/Interpreter/Lexicon/History.php b/src/Domain/Modules/Interpreter/Lexicon/History.php new file mode 100644 index 0000000..2afe87d --- /dev/null +++ b/src/Domain/Modules/Interpreter/Lexicon/History.php @@ -0,0 +1,62 @@ +builder = $builder; + } + + /** + * @param Context $context + * @param \Closure $next + * @return mixed + * @throws \Enzyme\Axiom\Exceptions\AtomException + * @throws \Enzyme\Collection\CollectionException + */ + public function handle(Context $context, \Closure $next) + { + $line = $context->current(); + list($key, $data) = $this->getKeyDataFromLine($line); + + if ($key === 'H' + && $context->isState($context::MODE_TUNE_HEADER) + ) { + $this->builder->addHistory(new StringAtom($data)); + $context->setStateInHistory(); + } elseif ($context->isState($context::MODE_HISTORY)) { + $this->builder->addHistory(new StringAtom($line)); + + if ($this->nextLineNotHistory($context)) { + $context->setStateInTuneHeader(); + } + } + + return $next($context); + } + + /** + * @param Context $context + * @return bool + * @throws \Enzyme\Collection\CollectionException + */ + private function nextLineNotHistory(Context $context) + { + $nextLine = $context->get($context->key() +1); + list($key, $data) = $this->getKeyDataFromLine($nextLine); + return $key !== ''; + } +} diff --git a/src/Domain/Modules/Interpreter/Lexicon/KeySignature.php b/src/Domain/Modules/Interpreter/Lexicon/KeySignature.php new file mode 100644 index 0000000..2171b10 --- /dev/null +++ b/src/Domain/Modules/Interpreter/Lexicon/KeySignature.php @@ -0,0 +1,41 @@ +builder = $builder; + } + + /** + * @param Context $context + * @param \Closure $next + * @return mixed + * @throws \Enzyme\Axiom\Exceptions\AtomException + */ + public function handle(Context $context, \Closure $next) + { + $line = $context->current(); + list($key, $data) = $this->getKeyDataFromLine($line); + + if ($context->getState() === $context::MODE_TUNE_HEADER && $key === 'K') { + $this->builder->setKey(new StringAtom($data)); + $context->setStateInTuneBody(); + } + + return $next($context); + } +} diff --git a/src/Domain/Modules/Interpreter/Lexicon/Meter.php b/src/Domain/Modules/Interpreter/Lexicon/Meter.php new file mode 100644 index 0000000..378bb29 --- /dev/null +++ b/src/Domain/Modules/Interpreter/Lexicon/Meter.php @@ -0,0 +1,42 @@ +builder = $builder; + } + + /** + * @param Context $context + * @param \Closure $next + * @return mixed + * @throws \Enzyme\Axiom\Exceptions\AtomException + */ + public function handle(Context $context, \Closure $next) + { + $line = $context->current(); + list($key, $data) = $this->getKeyDataFromLine($line); + + if ($key === 'M' + && $context->getState() === $context::MODE_TUNE_HEADER + ) { + $this->builder->setMeter(new StringAtom($data)); + } + + return $next($context); + } +} diff --git a/src/Domain/Modules/Interpreter/Lexicon/MusicLine.php b/src/Domain/Modules/Interpreter/Lexicon/MusicLine.php new file mode 100644 index 0000000..413f3a4 --- /dev/null +++ b/src/Domain/Modules/Interpreter/Lexicon/MusicLine.php @@ -0,0 +1,43 @@ +builder = $builder; + } + + /** + * @param Context $context + * @param \Closure $next + * @return mixed + * @throws \Enzyme\Axiom\Exceptions\AtomException + */ + public function handle(Context $context, \Closure $next) + { + $line = $context->current(); + list($key, $data) = $this->getKeyDataFromLine($line); + + if ($context->getState() === $context::MODE_TUNE_BODY + && $key !== 'K' + && $line !== '' + ) { + $this->builder->appendMusic(new StringAtom($line)); + } + + return $next($context); + } +} diff --git a/src/Domain/Modules/Interpreter/Lexicon/NoteLength.php b/src/Domain/Modules/Interpreter/Lexicon/NoteLength.php new file mode 100644 index 0000000..9ef7315 --- /dev/null +++ b/src/Domain/Modules/Interpreter/Lexicon/NoteLength.php @@ -0,0 +1,40 @@ +builder = $builder; + } + + /** + * @param Context $context + * @param \Closure $next + * @return mixed + * @throws \Enzyme\Axiom\Exceptions\AtomException + */ + public function handle(Context $context, \Closure $next) + { + $line = $context->current(); + list($key, $data) = $this->getKeyDataFromLine($line); + + if ($key === 'L') { + $this->builder->addNoteLength(new StringAtom($data)); + } + + return $next($context); + } +} diff --git a/src/Domain/Modules/Interpreter/Lexicon/Notes.php b/src/Domain/Modules/Interpreter/Lexicon/Notes.php new file mode 100644 index 0000000..001b9e6 --- /dev/null +++ b/src/Domain/Modules/Interpreter/Lexicon/Notes.php @@ -0,0 +1,40 @@ +builder = $builder; + } + + /** + * @param Context $context + * @param \Closure $next + * @return mixed + * @throws \Enzyme\Axiom\Exceptions\AtomException + */ + public function handle(Context $context, \Closure $next) + { + $line = $context->current(); + list($key, $data) = $this->getKeyDataFromLine($line); + + if ($key === 'N') { + $this->builder->addNote(new StringAtom($data)); + } + + return $next($context); + } +} diff --git a/src/Domain/Modules/Interpreter/Lexicon/Origin.php b/src/Domain/Modules/Interpreter/Lexicon/Origin.php new file mode 100644 index 0000000..02cb4eb --- /dev/null +++ b/src/Domain/Modules/Interpreter/Lexicon/Origin.php @@ -0,0 +1,40 @@ +builder = $builder; + } + + /** + * @param Context $context + * @param \Closure $next + * @return mixed + * @throws \Enzyme\Axiom\Exceptions\AtomException + */ + public function handle(Context $context, \Closure $next) + { + $line = $context->current(); + list($key, $data) = $this->getKeyDataFromLine($line); + + if ($key === 'O') { + $this->builder->addOrigin(new StringAtom($data)); + } + + return $next($context); + } +} diff --git a/src/Domain/Modules/Interpreter/Lexicon/Parts.php b/src/Domain/Modules/Interpreter/Lexicon/Parts.php new file mode 100644 index 0000000..6194715 --- /dev/null +++ b/src/Domain/Modules/Interpreter/Lexicon/Parts.php @@ -0,0 +1,42 @@ +builder = $builder; + } + + /** + * @param Context $context + * @param \Closure $next + * @return mixed + * @throws \Enzyme\Axiom\Exceptions\AtomException + */ + public function handle(Context $context, \Closure $next) + { + $line = $context->current(); + list($key, $data) = $this->getKeyDataFromLine($line); + + if ($key === 'P' + && $context->getState() === $context::MODE_TUNE_HEADER + ) { + $this->builder->setParts(new StringAtom($data)); + } + + return $next($context); + } +} diff --git a/src/Domain/Modules/Interpreter/Lexicon/Rhythm.php b/src/Domain/Modules/Interpreter/Lexicon/Rhythm.php new file mode 100644 index 0000000..3c93c44 --- /dev/null +++ b/src/Domain/Modules/Interpreter/Lexicon/Rhythm.php @@ -0,0 +1,42 @@ +builder = $builder; + } + + /** + * @param Context $context + * @param \Closure $next + * @return mixed + * @throws \Enzyme\Axiom\Exceptions\AtomException + */ + public function handle(Context $context, \Closure $next) + { + $line = $context->current(); + list($key, $data) = $this->getKeyDataFromLine($line); + + if ($key === 'R' + && $context->getState() === $context::MODE_TUNE_HEADER + ) { + $this->builder->addRhythm(new StringAtom($data)); + } + + return $next($context); + } +} diff --git a/src/Domain/Modules/Interpreter/Lexicon/Source.php b/src/Domain/Modules/Interpreter/Lexicon/Source.php new file mode 100644 index 0000000..c448953 --- /dev/null +++ b/src/Domain/Modules/Interpreter/Lexicon/Source.php @@ -0,0 +1,42 @@ +builder = $builder; + } + + /** + * @param Context $context + * @param \Closure $next + * @return mixed + * @throws \Enzyme\Axiom\Exceptions\AtomException + */ + public function handle(Context $context, \Closure $next) + { + $line = $context->current(); + list($key, $data) = $this->getKeyDataFromLine($line); + + if ($key === 'S' + && $context->getState() === $context::MODE_TUNE_HEADER + ) { + $this->builder->addSource(new StringAtom($data)); + } + + return $next($context); + } +} diff --git a/src/Domain/Modules/Interpreter/Lexicon/Tempo.php b/src/Domain/Modules/Interpreter/Lexicon/Tempo.php new file mode 100644 index 0000000..4650d5f --- /dev/null +++ b/src/Domain/Modules/Interpreter/Lexicon/Tempo.php @@ -0,0 +1,40 @@ +builder = $builder; + } + + /** + * @param Context $context + * @param \Closure $next + * @return mixed + * @throws \Enzyme\Axiom\Exceptions\AtomException + */ + public function handle(Context $context, \Closure $next) + { + $line = $context->current(); + list($key, $data) = $this->getKeyDataFromLine($line); + + if ($key === 'Q') { + $this->builder->addTempo(new StringAtom($data)); + } + + return $next($context); + } +} diff --git a/src/Domain/Modules/Interpreter/Lexicon/Transcriber.php b/src/Domain/Modules/Interpreter/Lexicon/Transcriber.php new file mode 100644 index 0000000..8427eb7 --- /dev/null +++ b/src/Domain/Modules/Interpreter/Lexicon/Transcriber.php @@ -0,0 +1,40 @@ +builder = $builder; + } + + /** + * @param Context $context + * @param \Closure $next + * @return mixed + * @throws \Enzyme\Axiom\Exceptions\AtomException + */ + public function handle(Context $context, \Closure $next) + { + $line = $context->current(); + list($key, $data) = $this->getKeyDataFromLine($line); + + if ($key === 'Z') { + $this->builder->addTranscriber(new StringAtom($data)); + } + + return $next($context); + } +} diff --git a/src/Domain/Modules/Interpreter/Lexicon/Words.php b/src/Domain/Modules/Interpreter/Lexicon/Words.php new file mode 100644 index 0000000..8900e24 --- /dev/null +++ b/src/Domain/Modules/Interpreter/Lexicon/Words.php @@ -0,0 +1,40 @@ +builder = $builder; + } + + /** + * @param Context $context + * @param \Closure $next + * @return mixed + * @throws \Enzyme\Axiom\Exceptions\AtomException + */ + public function handle(Context $context, \Closure $next) + { + $line = $context->current(); + list($key, $data) = $this->getKeyDataFromLine($line); + + if ($key === 'W') { + $this->builder->addWords(new StringAtom($data)); + } + + return $next($context); + } +} diff --git a/tests/_data/abc/jigs.abc b/tests/_data/abc/jigs.abc new file mode 100644 index 0000000..1cd987a --- /dev/null +++ b/tests/_data/abc/jigs.abc @@ -0,0 +1,684 @@ +%abc +%%abc-alias Jigs I Play +%%abc-creator ABCexplorer 1.3.7 [2010-06-20] +% Richard's Tune Book +% jigs.abc +%% to add +% ships in full sail + +X:14 +T:Emmett's Hedgehog +Z:robin.beech@mcgill.ca +R:jig +S:Niall Vallely - Beyond Words +M:6/8 +L:1/8 +K:Ador +A2e edB | A2A AGE | A2A AGE | GAG DEG | +A2e edB | A2A AGE | GAG DEG | BAG AEG :| +e2a ged | c2B BAG | B2B BAG | g2f edB | +e2a ged | c2B BAG | Bgf edB | EFG ABd :| + +X:21 +T: North Star, The +D: Flook - Rubai - Track 2 +C: Brian Finnegan +M: 6/8 +L: 1/8 +R: jig +K:Gmaj +G2D G B/2c/2d|cBG dBG|~E3 dBG|F2d cde| +G2D G B/2c/2d|cBG dBG|EGd ~F2d|1~G3 dBA:|2~G3 GAB|| +G2F G2d|ABF G2D|EFG Adc-|cBG ADB| +G2F G2d|ABF G2D|EFG ADF|G2B DAD| +G2F G2d|ABF G2D|EFG Adc-|cBG ADB| +G2F G2d|dcB G2D|EFG ADF|G2z dBA|| + +X:22 +T: Ghost Of Ballybrolly, The +D: Flook - Rubai - Track 2 +M: 6/8 +L: 1/8 +R: jig +K:Emin +ABB eze-|edB A3-|AGE ~G2B|E B/2c/2d edB| +~B3 eBe|edB ~A3|AGE ~G3|AED E2z| +ABB eBe|edB ~A3|AGE ~G2B|E B/2c/2d ~e3| +ged BAB|edB A2A|AGE ~G3|AED E2z| +cG ~E3 c|BGA E2d|AFD DEF|GAB dBe| +cG ~E3 c|BGA E2d|AFD DEF|~E3 FGA| +cG ~E3 c|BGA E2d|AFD DEF|GAB dBe-| +edB e2g|deB- Bed|BAA ABd|ez2 g3| + +X:1 +T:The Coming Of Spring +C:Paddy O'Brien +M:6/8 +L:1/8 +R:jig +K:Edor +|: BEE B2 A | (3Bcd B BAG | F3 DFA | dfe dBA | +BEE B2 A | Bef gfe | dBG FGA |1 BGE Ed=c :|2 BGE E2 F |: +GEF G2 A | B2 A Bec | dAA BAG | (3FGA F DEF | +GFE FGA | Bef gfe | dBG FGA |1 BEE E2 F :|2 BEE Eef || +g3 efe | Beg bag | f2 d dcd | AFA def | +g2 e efe | Beg bag | fed (3fga f | ge^d e2 f | +g2 e efe | Beg bag | f2 d dcd | AFA def | +g2 e fed | Bec dfe | dBG FGA | BGE Ed=c |] + +X:23 +T:The Dusty Windowsill +T:Austin Barratts +C:Sean Harling +R:jig +M:6/8 +L:1/8 +K:Ador +A2B cBA | eAB cBA | G3 EGG | DGG EGG | A2B cBA | e2d efg | +age dBe |1 ABA A2G :|2 ABA A2g |: aga bge| def g2f | g3 gfe | dBA G3 | +EGG DGG | EGG ABc | Bed BAG |1 BAG A2g :|2 BAG A2G |: A3 gAf | +A3 edB | G3 eGd | G3 edB | A3 gAf | ABA efg | age dBe | ABA A2G :| + +X:1 +T:Banish Misfortune +R:jig +M:6/8 +L:1/8 +K:Dmix +fed cAG | A2d cAG | F2F DED| F2F GFG | +A3 cAG | AGA cde | fed cAG | Ad^c d2e :| +|:f2d d^cd | f2g agf | e2c cBc | e2f gfe | +f2g agf | e2f gfe | fed cAG | Ad^c d2e :| +|:f2g e2f | d2e c2d | ABA GAG | FGE FED | +c3 cAG | AGA cde | fed cAG | Ad^c d2e :| + +X:2 +T:Banshee's Wail +C:Vincent Broderick +R:jig +M:6/8 +L:1/8 +K:G +GED DED | GBd ege | dBA AGA | BGE E2A | +GED DED | GBd ege | dBA AGA | BGF G2A :| +Bdd edd | gdd edB | BAG GAB | AGE E2G | +Bdd edd | gdd edB | BAG GAB | AGF G3 | +Bdd edd | gdd edB | BAG GAB | AGE E2A | +GED DED | GBd ege | dBA AGA | BGF G3 |] + +X:3 +T:The Battering Ram +R:jig +M:6/8 +L:1/8 +K:G +B | dBG BAG | dBG G2B | dBG AGE | GED D2B | dBG BAG | BdB BAG | +AGA BAB | GED D2 :: B | deg aga | bge edB | deg aga | bge ega | +bag age | ged ege | dBG AGE | GED D2 :: d/c/ | B2G A2G | B2D Ddc | +B2G AGE | GED Ddc | B2G A2G | BdB BAG | AGA BAB | GED D2 :| + +X:198 +T:Bending the Ferret +C:Doug Eunson +Z:Steve Beech 23/04/2008 +R:Jig +M:6/8 +L:1/8 +K:G +|: G2B ABA | GBd g2d | edc BAG |1 A2c cBA :|2 A2F G3 :| +|:e2e dcB | ABc dcd | e2e dcB | ABc def | +g2d BAG| ABc ABc | B2B cAF | G6:| + +X:5 +T:Blackthorne Stick +R:jig +M:6/8 +L:1/8 +K:G +d | gfg ege | dBG AGE | DGG FGA | BAG A2d | +gfg age | dBG AGE | DGG FGA | BGG G2 :| +|:d | edd gdd | edd gdd | ede gfe | dcB A2d | +gfg age | dBG AGE | DGG FGA | BGG G2 :| + +X:6 +T:The Blarney Pilgrim +Z:Transcribed by Frank Nordberg - http://www.musicaviva.com +R:jig +B:Francis O'Neill:"The Dance Music of Ireland" (1907) no. 291 +M:6/8 +L:1/8 +K:G +DED DEG | A2G ABc | BAG AGE | GEA GED | DED DEG | A2G ABc | +BAG AGE | GED D2z :: ded dBG | AGA BGE | ded dBG | AGA G3 | +g2e dBG | AGA BGE | B2G AGE | GED D2z :: A2D B2D | A2D ABc | +BAG AGE | GEA GED | A2D B2D | A2D ABc | BAG AGE | GED D2z :| + +X:10 +T:Butlers of Glen Avenue +C:Tom Sullivan +Z:Philippe Murphy +R:jig +N:Title changed from Christy Barry's number 2. Thanks to Stephen Rapp +M:6/8 +L:1/8 +K:G +DEG EDB | DEG B3 | DEG B2e | dBe dBA | +DEG EDB | DEG B3 | d (3B^cd gfe |1 dBA G3 :|2 dba g3 |: +gab age | deg B3 | gab gab | d (3B^cd e2d | +gab age | deg B3 | d (3B^cd gfe |1 dba g3 :|2 dBA G3 || + +X:176 +T:Calliope House +C:D Richardson +Z:John Chambers +R:jig +N:Calliope House is a folk center in Pittsburgh. +M:6/8 +L:1/8 +K:D +A | dAA fAA | eAA fAA | Bee e2d | efd BdB | +ABA A2F | A2B d2e |1 faf fed | e3- ez :|2 faf edB | d3- d |: +fg | a3 faa | eaa daa | g3 fgf | efe edB | +ABA A2F | A2B d2e |1 faf fed | e3- e :|2 faf edB | d3- d |] + +X:11 +T:Charlie Hunter +T:Charlie Stuart's Jig +C:Bobby MacLeod +Z:Nigel Gatherer +R:jig +S:Bobby MacLeod's Selection of Country Dance Tunes +M:6/8 +L:1/8 +K:D +DFA DGB | Adf a2g | fed Bcd | ecA GFE | +DFA DGB | Adf a2g | fef gec |1 edc d2A :|2 edc dfg |: +afd dcd | BGF G2F | E^GB e2d | cAA Aag | +fdA FDF | GBd g2g | fef gec |1 edc dfg :|2 edc d3 |] + +X:12 +T:Christy Barry's No. 1 +C:Christy Barry +Z:Philippe Murphy 2006-02-28 +R:jig +M:6/8 +L:1/8 +K:G +G3 BAG | AAB d2e | ged BGG | A3 BGE | +DGG BGG | AAB d2e | ged BGG |1 AGF G2D :|2 AGF G (3B^cd |: +g3 gfg | aag d2e | ged BGG | A3 BGE | +DGG BGG | AAB d2e | ged BGG |1 AGF G (3B^cd :|2 AGF G2D |] + +X:179 +T:Jim Ward's +T:Ciaran's Capers +Z:robin.beech@mcgill.ca +R:jig +S:Simon Granger +M:6/8 +L:1/8 +K:Amix +ed | c2A ABA |dcd e3 | Ace efg | BGB dcB | +cBA ABA | dcd e3 | Ace dde | A3 A :: +fg | agf gfe | fed ecA | def gfg | B2B Bfg | +agf gfe | fed ecA | Ace dde | A3 A :| + +X:13 +T:The Clare Jig +R:jig +M:6/8 +L:1/8 +K:Em +G3G2B | AGE GED | G3 AGE | GED D2E | +G3G2B | AGE GAB | c2A BGE |1 DED D3 :|2 DED D2B |: +c2A B2A | AGE GAB | cBA BGE | DED D2B | +c2A B2A | AGE GAB | c2A BGE |1 DED D2B :|2 DED D3 |] + +X:14 +T:The Cliffs of Moher +R:jig +M:6/8 +L:1/8 +K:Ador +aga bag | eaf ged | c2A BAG | EAF GED | aga bag | eaf ged | +c2A BAG | EFG A3 :| e2e dBA | e=fe dBA | GAB dBA | GAB dBd | +e2e dBA | e=fe dBA | GAB dBA | BAG A3 | e=fe dBA | e=fe dBA | +GAB dBA | GAB dBd | e2e dee | cee Bee | GAB dBA | EFG A3 |] + +X:148 +T:Condon's Frolics +R:jig +M:6/8 +L:1/8 +K:Ador +eAB c2d | edc Bcd | eAB c2d | e2d eag | +eAB c2d | edc AB2 | GBd gdB |1 A3 a2g :|2 A3 AB/c/d |: +eaa efg | dec BAG | cGe d2d | e2d efg | +eaa efg | dec BAB | GBd gdB |1 A3 AB/c/d :|2 A3 a2g |] + +X:15 +T:Connaught-Man's Ramble +Z:Contributed by Ray Davies, ray(at)davies99.freeserve.co.uk +R:jig +B:Ryan's Mammoth Collection +M:6/8 +L:1/8 +K:D +A/G/ | FAA dAA | BAB dAG | FAA dfe | dBB BAG | +FAA dAA | BAB def | gfe dfe | dBB B2 :| +|:g | fbb faa | fed deg | fbb faa | fed e2g | +fbb faa | fed def | gfe dfe | dBB B2 :| + +X:16 +T:Cook In the Kitchen +R:jig +M:6/8 +L:1/8 +K:G +DGG GAG | FDE F3 | DGG GFG | Add cAG | +DGG GAG | FDE =F2d | cAG FGA |1 BGF G3 :|2 BGF G2A |: +B3 BAG | A3 AGF | G3 GFG | Add cAG | +B3 BAG | A3 A2d | cAG FGA |1 BGF G2A :|2 BGF G3 |: +d2e f2g | a2g fed | cAG FGA | B3 cAG | +d2e f2g | a2g fed | cAG FGA | BGF G3 :| + +X:18 +T:Dingle Regatta +R:jig +M:6/8 +L:1/8 +K:D +dcd e2d | BAB d2B | ABA AGA | B2A G3 | dcd e2d | BAB d2B | +ABA B2A | G3- G3 :: d3 def | g3 gfg | a3 aga | b2a gfe | d3 def | +g3 gab | a2g f2e | def g3 :: gfg dgd | BdB GBG | FAF DEF| +GAB def | gfg dgd | BdB GBG | FAF DEF | G3 G3 :| + +X:19 +T:Doctor O'Neill +Z:Frank Nordberg - http://www.musicaviva.com +R:jig +B:Francis O'Neill:"The Dance Music of Ireland" (1907) no. 6 +M:6/8 +L:1/8 +K:D +A | d3 AFD | E2F G2A | BGB Bcd | AGF EFA | d3 AFD | E2F G2A | +BGB Bcd | AFD D2 :: A | d3 ceA | dfe dcB | AFA Bcd | AGF EFA | +d3 ceA | dfe dcB | AFA Bcd | AFD D2 :: g | fef afd | ded fed | +gbg faf | gee e2g | fef afd | ded fed | gbg fag | fdd d2 :| +|:g | fdf ece | dcB AFA | AFd AFd | AGF E2g | fdf ece | dcB AFA | +AFA Bcd | AFD D2 :: G | FAF GBG | FAG FED | FAF GBG | +AGF E2G | FAF GBG | FAG FED | BGB Bcd | AFD D2 :| + +X:20 +T:The Donegal Lass +C:Brian Finnegan +R:jig +D:Brian Finnegan - When the Party's Over +M:6/8 +L:1/8 +K:Amix +Ace aed | cdB A3 | GBd G3 | FAd F3 | Ace aed | cdB A2^g | aed cdB | A3 A3 :| +|:GBd G3 | FAd F3 | e3 ecA | e3 ecA | GBd G3 | FAd F2^g | aed cdB | A3 A3 :| + +X:136 +T:Emmett's Hedgehog +Z:robin.beech@mcgill.ca +R:jig +S:Niall Vallely - Beyond Words +M:6/8 +L:1/8 +K:Ador +A2e edB | A2A AGE | A2A AGE | GAG DEG | +A2e edB | A2A AGE | GAG DEG | BAG AEG :| +|:e2a ged | c2B BAG | B2B BAG | g2f edB | +e2a ged | c2B BAG | Bgf edB | EFG ABd :| + +X:200 +T:The False Proof +C:Jowan Merckx +R:jig +S:rubai (flook) +M:6/8 +L:1/8 +K:Bmin +|: Bdf fef | fed c2f | edc B2B | ABd cAF | +GBd f2a | fed c2f | edc B2A | BcA B3 :: +zdc BcA | GFE F2E- | EDE G2E- |EFG dcA | +Bdc BcA | GFE F2E- | EFG e2d | cBA B3 :| +|:BdB fBg | Bag fed | e2d c2f | ede edB | +BAB fBg | Baf bz2 | bag fag |1 fed ecA :|2 fed e2d |] + +X:26 +T:Father O'Flynn +T:Top of the Cork Road +R:jig +S:Gerry Strong +M:6/8 +L:1/8 +K:D +A | dAF DFA | ded cBA | dcd efg | fed cBA | +dAF DFA | ded cBA | dcd efg | fdd d2 :| +|:g | fdf fga | ecA ABc | dcd Bed | cAA A2c | +BGB Bcd | AFD DFA | dcd efg | fdd d2 :| + +X:27 +T:The Frost Is All Over +T:The Mist Of Clonmel +R:jig +M:6/8 +L:1/8 +K:D +A | def edB | AFD E2 D | FAA AFA | Bee edB | +def edB | AFD E2 D | FAA AFA | Bdc d2 :| +|:e | f3 afd | g3 bag | f3 afd | gfg efg | +f3 afd | g3 bag | fga efg | fdc d2 :| + +X:36 +T:Hag At the Churn +R:jig +M:6/8 +L:1/8 +K:G +A2G ADD | A2G Adc | A2G ADD | EFG EFG | A2G ADD | +A2G Adc | A2G ADD | EFG EFG |AdB c3 | Add efg | +AdB c2A | GEG AED | AdB c3 | Add efg | age dcA | GEG AED |] + +X:37 +T:The Halloween Jig +C:Jean Duval +Z:robin.beech@mcgill.ca +R:jig +M:6/8 +L:1/8 +K:D +F |: B2B Bcd | c2A ABc | B2G GAB | A2F FEF | B2B Bcd | c2A ABc | +def edc |1 B3 BAF :|2 B3 Bde |: f2f fed | cde Adc | Bcd dcB | +cFF Fde | f2f fed | cde Adc | Bcd cBA |1 B3 Bde :|2 B3 B3 |] + +X:38 +T:Hammy Hamilton's +R:jig +M:6/8 +L:1/8 +K:G +B | dBG cGE | DED GFG | BAB dBG | dcB ABc | dBG cGE | DED GFG | BAB dcA | +AGF G2 :: B | dBG ecA | fef gfg | ege dBG | dcB ABc |1 dBG ecA | fef gfg | +ege dcA | AGF G2 :|2 dBG cGE | DED GFG | BAB dcA | AGF G2 |] + +X:39 +T:Haste To the Wedding +R:jig +M:6/8 +L:1/8 +K:D +AFA Agf | ede fdB | AFA AGF | GFG EFG | +AFA Agf | ede fdB | A2a faf | ded d3 :| +|:afa afa | bgb bgb | afa agf | gfg efg | +a3 f3 | ede fdB | A2a faf | ded d3 :| + +X:40 +T:Haunted House +C:Vincent Broderick +R:jig +M:6/8 +L:1/8 +K:G +G3 AGA | BGE EDE | GBd egd | ege edB | +G3 AGA | BGE EDE | GBd ege | dBA G2D :| +GBd egd | ege edB | GBd ded | ded dBA | +GBd egd | ege edB | GBd ege | dBA G2D | +GBd egd | ege edB | GBd ded | ded dBA | +G3 AGA | BGE EDE | GBd ege | dBA G3 |] + +X:43 +T:Humours of Ballyloughlin +R:jig +M:6/8 +L:1/8 +K:Dmix +A | A3 AGE | GED EDE | c3 cAd | dcA AGE | +A3 AGE | GEG cGE | DED DFA | DED D2 :| +|:B | c3 cAB | cAG ABc | d3 ded | dAF DFA | +c2A d2B | cAG FGE | DED DFA | DED D2 :| +|:e | f2d ged | f2d ged | cde ged | cde ged | +f2d ged | f2d ged | cde gag | ed^c d2 :| +|:B | A3 ABG | F3 GED | E3 EFD | EFD EFG | +A3 dAG | F3 GEA | DED DFA | DED D2 :| + +X:44 +T:Humours of Ennistymon +Z:robin.beech@mcgill.ca +R:jig +M:6/8 +L:1/8 +K:G +BAB GBd | cBc ABc | BcB GBd | cAG FGA | +B2B GBd | cBc ABc | ded cAF | AGF G3 :| +|:fgf fed | cAG FGA | Bgg gfg | afd d2 e | +fgf fed | cAG FGA | BdB cAF | AGF GBd :| +|:gdB gdB | ecA ecA | BcB GBd | cAG FGA |1 +gdB gdB | ecA ecA | BAB cAF| AGF G3 :|2 +BAB GBd | cBc ABc | ded cAF | AGF G3 |] + +X:46 +T:Indian Point +C:Rick Mohr +Z:Kevin Alewine at kalewine:HOME.COM irtrad-l 2001-5-15 +R:jig +M:6/8 +L:1/8 +K:Em +B,EF G2A | BAG FED | CEF G2A | BAG BAG | FED A,2D | +FED AGF |1 EFG BAG | F2F GFE :|2 BAG FEF | E3 E2A |: +Bef gfe | cef gfe | dfg agf | gfe fed | Bef gfe | +ceg a2a |1 bag fef | e2f gfe :|2 bag fef | e3 ez2 |] + +X:47 +T:Ingonish +R:jig +M:6/8 +L:1/8 +K:Edor +Bee efg | fef dBA | Bee efg | fdc d3 | +Bee efg | fef dBA | BdB AFD | EFE E3 :| +|:BEE BEE | FEF DFA | BEE BEE | ABc dcd | +BEE BEE | FEF D2A | BdB AFD | EFE E3 :| + +X:48 +T:Irish Washerwoman +R:jig +M:6/8 +L:1/8 +K:G +dc | BGG DGG | BGB dcB | cAA EAA | cBc edc | +BGG DGG | BGB dcB | cBc Adc |1 BGG G :|2 BGG G2 |: +g | gdg gdg | gdg bag | fdf fdf | fdf agf | +egg dgg | cgg Bgg | cBc Adc |1 BGG G2 :|2 BGG G |] + +X:8 +T:I Buried my Wife and Danced on her Grave +R:jig +M:6/8 +L:1/8 +K:D +DED F2G | AdB =cAF | G2A BAG | F2F GEA | +DED F2G | AdB =cAF | G2A BAG | AFD D2A :| +|:d2e fed | faf gfe | d2e fed | d=cA d=cA | +d2e fed | faf gfe | d2A BAG | AFD D2A :| + +X:49 +T:The Jig of Slurs +R:jig +N:also known as the "Jug of Slugs" +M:6/8 +L:1/8 +K:D +Add (dcd) | Bdd Add | Bdd Add | Bee (edB) | Add (dcd) | Bdd Add | +Bdd cde |1 fdc d3 :|2 fdc d2 B|: Aff (fef) | aff (fed) | Bee (ede) | +fef (edB) | Aff (fef) | aff (fed) | Bdd cde |1 fdc d2B :|2 fdc d2B/A/ +K:G +|: Ggg (gfg) | age (gdB) | Ggg (gfg) | age (g2 B) | Ggg (gfg) | age (gdB) | +Bee egg |1 fdd e2 B/A/ :|2 fdd e3 |: GBB Bdd | dee (edB) | +GBB Bdd | dee egg | GBB Bdd | dee (edB) | Bee egg | fdd e3 :| + +X:50 +T:Jim Ward's +R:jig +M:6/8 +L:1/8 +K:G +EF | G3 GAB | AGE GED | G3 AGE | GED DEF | +G3 GAB | AGE GAB | cBA BGE |1 DED D :|2 DED D2 |: +B | cBA BAG | A3 AGE | cBA BGE | DED D2B | +cBA BAG | A3 ABc | dcB AGE |1 GED D2 :|2 GED D |] + +X:166 +T:Johnny O'Leary's +Z:robin.beech@mcgill.ca +R:jig +S:John Williams - Steam +M:6/8 +L:1/8 +K:EDor +B3 EGA | B2A BAd | B3EGA | BAG FED | +B3 EGA | B2B BAd | AFD DEF | A2G FED :| +|:g3 fed | edc d2A | B3EGA | BAG FED | +gbg fed | edc d2B | AFD DEF | A2G FED :| +|:DEE EFD | EFD EEE | DEE EFG | BAG FED | +EEE EFD | EFD EEE | AFD DEF | A2G FED :| + +X:1 +T: Gallagher's Frolics +M: 6/8 +L: 1/8 +R: jig +K:Edor +D |: E3 GFE | B3 dBA | BdB BAB | GBG AFD | +E3 GFE | BAB dBA | BAG FAF |1 GEE E2D :|2 GEE E2e |: +e2g gfe | g2b bge | dcd fed | fad fed | +e2f gfe | dfe dBA | BAG FAF |1 GEE E2e :|2 GEE E2D |] + +X:43 +T:Horizonto +C: Paul James +R:jig +M:6/8 +L:1/8 +K:Dmin +ABA GAF | GEF DEC | A,2A, DEF | E2E CDE | +F2F FGF | EDE CDE | FED EDC | A,=B,C D3 :| +B,2B, DEF | B,2B, DEF | A,2A, DEF |A,2A, DEF| +B,2B, DEF | B,2B, DEF | ABA GAF | GEF DEC | +B,2B, DEF | B,2B, DEF | A,2A, DEF | A,2A, DEF | +B,2B, DEF | B,2B, DEF | =B,2B, DEF | =B,2B, DEF | +B2A2GF | E3 EFG | A2G2FE | D3 DEF| +G2F2ED | ^C3 CDE | F2G2^G2 | A3 AGA| +B2c2B2 | E3 EFG | A2B2A2 | D3 DEF| +G2F2ED | ^C3 CDE| F2 D2 C2 | D2 Z4 |] + +X:44 +T:Horizonto +C: Paul James +R:jig +M:6/8 +L:1/8 +K:Bmin +fgf efd | ecd BcA | F2F Bcd | c2c ABc | +d2d ded | cBc ABc | dcB cBA | F^GA B3 :| +G2G Bcd | G2G Bcd | F2F Bcd |F2F Bcd| +G2G Bcd | G2G Bcd | fgf efd | ecd BcA | +G2G Bcd | G2G Bcd | F2F Bcd | F2F Bcd | +G2G Bcd | G2G Bcd | ^G2G Bcd | ^G2G Bcd | +g2f2ed | c3 cde | f2e2dc | B3 Bcd| +e2d2cB | ^A3 ABc | d2e2=f2 | f3 fef| +g2a2g2 | c3 cde | f2g2f2 | B3 Bcd| +e2d2cB | ^A3 ABc| d2 B2 A2 | B2 Z4 |] + +X:45 +T:The False Proof +C:Jowan Merckx +R:jig +S:rubai (flook) +M:6/8 +L:1/8 +K:Bmin +|: Bdf fef | fed c2f | edc B2B | ABd cAF | +GBd f2a | fed c2f | edc B2A | BcA B3 :| +|:zdc BcA | GFE F2E- | EDE G2E- |EFG dcA | +Bdc BcA | GFE F2E- | EFG e2d | cBA B3 :| +|:BdB fBg | Bag fed | e2d c2f | ede edB | +BAB fBg | Baf bz2 | bag fag |1 fed ecA :|2 fed e2d |] + +X:1 +T: Son Ar Rost +M: 12/8 +L: 1/8 +R: slide +K:Ador +|:A2A ABG AGE c2d|cBA B2c A2G EFG| +A2A ABG AGE c2d|cBA GAB A3 A2 E:| +|:A2B d3 cBA G2A|c2B A3 GAB E2D| +EAB d2e cBA G2A|c2B ABG A3 A2 E:| + +X:1 +T: Jig For John +M: 6/8 +L: 1/8 +R: jig +K:Dmaj +|:B | A2f c/d/ef | gec dfa | g2a fed | cBA G2A | +FAd GBd | Ace fdB | ~A3 B/c/de | edc d2 :| +|:c | ~B3 BgB| fBe Bdc | ~A3 fAg | age f2d | +~B3 BgB| fBe Bdc | ~A3 B/c/de | edc d2 :| + +X:1 +T: Mouse In The Kitchen +M: 6/8 +L: 1/8 +R: jig +K:Amaj +|: c3 cde | dcA F2A | E3 ABc | B3 BAB | +c3 cde | dcA F2a | afe fec | cBe Adc :| +|: B3 BAB | c3 cBA | B3 BAB | cea zdc | +B3 BAB | c3 cBA | afe fec | cBe Adc :| + +X:1 +T: John Brady's +M: 6/8 +L: 1/8 +R: jig +K:Edor +|:A|Bed B2G|AFD EFA|Bed B2G|Eag e2d| +eaf g2e|dBA G2A|Bed BAG|Bcd E2:| +|:F|GFG AGA|BAB e2f|gfe fed|Bcd e2f| +gfe fed|BAF DEF|~G3 ~F3|Bcd E2:| + +X:166 +T:Johnny O'Leary's +Z:robin.beech@mcgill.ca +R:jig +S:John Williams - Steam +M:6/8 +L:1/8 +K:EDor +B3 EGA | B2A BAd | B3EGA | BAG FED | +B3 EGA | B2B BAd | AFD DEF | A2G FED :| +|:g3 fed | edc d2A | B3EGA | BAG FED | +gbg fed | edc d2B | AFD DEF | A2G FED :| +|:DEE EFD | EFD EEE | DEE EFG | BAG FED | +EEE EFD | EFD EEE | AFD DEF | A2G FED :| + +X:1 +T: Deirdre Hurley's +M: 6/8 +L: 1/8 +R: jig +K:Edor +B2e edB|AB/c/d B2A|G3 GFE|FBA FED| +B2e edB|AB/c/d B2A|G3 GFE|FBD E2A:| +|:B2e ede|f2a afa|bag agf|g2e fed| +B2e ede|f2a afa|bag agf|efd ed=c:| +|:B3 BAG|A3 B2A|G3 GFE|FBA FED| +B3 BAG|A3 B2A|G3 GFE|FBD E2A:| + + diff --git a/tests/_support/_generated/UnitTesterActions.php b/tests/_support/_generated/UnitTesterActions.php index 3462387..c723643 100644 --- a/tests/_support/_generated/UnitTesterActions.php +++ b/tests/_support/_generated/UnitTesterActions.php @@ -1,14 +1,10 @@ -assertInstanceOf(AtomInterface::class, $result); + $this->assertEquals($value, $result->getValue()); + } + + /** + * @expectedException \Enzyme\Axiom\Exceptions\AtomException + */ + public function testCreateAtom0Fails() + { + $value = 0; + + $result = new UnsignedIntegerAtom($value); + + $this->assertEquals(false, $result, 'should have failed to create'); + } + + /** + * @expectedException \Enzyme\Axiom\Exceptions\AtomException + */ + public function testCreateNegativeAtomFails() + { + $value = -1; + + $result = new UnsignedIntegerAtom($value); + + $this->assertEquals(false, $result, 'should have failed to create'); + } +} diff --git a/tests/unit/AbcParser/Domain/Core/PersonTest.php b/tests/unit/AbcParser/Domain/Core/PersonTest.php new file mode 100644 index 0000000..ce850f9 --- /dev/null +++ b/tests/unit/AbcParser/Domain/Core/PersonTest.php @@ -0,0 +1,26 @@ +assertInstanceOf(Person::class, $person); + } +} diff --git a/tests/unit/AbcParser/Domain/Core/TuneTest.php b/tests/unit/AbcParser/Domain/Core/TuneTest.php new file mode 100644 index 0000000..eb88ef6 --- /dev/null +++ b/tests/unit/AbcParser/Domain/Core/TuneTest.php @@ -0,0 +1,171 @@ +assertInstanceOf(Tune::class, $tune); + } + + public function testNewTuneHasIdentitySet() + { + $params = []; + + $tune = new Tune($params); + + $result = $tune->identity(); + + $this->assertInstanceOf(Uuid::class, $result); + } + + public function testGetIndexReturnsInteger1AsDefault() + { + $tune = new Tune([]); + + $result = $tune->getIndex(); + + $this->assertInternalType('integer', $result); + $this->assertEquals(1, $result); + } + + public function testSetIndex() + { + $value = 12; + $tune = new Tune([]); + $tune->setIndex(new UnsignedIntegerAtom($value)); + + $result = $tune->getIndex(); + + $this->assertEquals($value, $result); + } + + public function testGetTitlesIsEmptyOnNewTune() + { + $tune = new Tune([]); + + $result = $tune->getTitles(); + + $this->assertEmpty($result); + } + + public function testAppendTitleAddsOneTitle() + { + $newTitle = 'New Title'; + $tune = new Tune([]); + $tune->addTitle($newTitle); + + $result = $tune->getTitles(); + + $this->assertNotEmpty($result); + $this->assertEquals($newTitle, $result[0]); + } + + public function testAddAuthor() + { + $authorName = new StringAtom('Bob'); + $authorEmail = new EmailAtom('me@example.com'); + $author = new Author($authorName, $authorEmail); + $tune = new Tune([]); + $tune->addAuthor($author); + + $result = $tune->getAuthors(); + + $this->assertNotEmpty($result); + $this->assertEquals($author, $result[0]); + } + + public function testAddComposer() + { + $composerName = new StringAtom('Bob'); + $authorEmail = new EmailAtom('me@example.com'); + $composer = new Composer($composerName, $authorEmail); + $tune = new Tune([]); + $tune->addComposer($composer); + + $result = $tune->getComposers(); + + $this->assertNotEmpty($result); + $this->assertEquals($composer, $result[0]); + } + + public function testAddGroup() + { + $group = 'flutes'; + $tune = new Tune([]); + $tune->addGroup($group); + + $result = $tune->getGroups(); + + $this->assertNotEmpty($result); + $this->assertEquals($group, $result[0]); + } + + public function testAddHistoryLine() + { + $historyLine = 'The works of Shakespeare'; + $tune = new Tune([]); + $tune->addHistoryLine($historyLine); + + $result = $tune->getHistory(); + + $this->assertNotEmpty($result); + $this->assertEquals($historyLine, $result[0]); + } + + public function testAddOrigin() + { + $origin = 'Yorkshire'; + $tune = new Tune([]); + $tune->addOrigin($origin); + + $result = $tune->getOrigins(); + + $this->assertNotEmpty($result); + $this->assertEquals($origin, $result[0]); + } + + public function testAddRhythm() + { + $rhythm = 'reel'; + $tune = new Tune([]); + $tune->addRhythm($rhythm); + + $result = $tune->getRhythms(); + + $this->assertNotEmpty($result); + $this->assertEquals($rhythm, $result[0]); + } + + public function testSetting() + { + $setting = new Setting(); + $tune = new Tune([]); + $tune->addSetting($setting); + + $result = $tune->getSettings(); + + $this->assertNotEmpty($result); + $this->assertEquals($setting, $result[0]); + } +}