Skip to content
This repository has been archived by the owner on Aug 18, 2020. It is now read-only.

[CDEC-500] Factor out example datatypes from Json+Bi tests #3403

Merged
merged 1 commit into from
Aug 15, 2018

Conversation

mhuesch
Copy link
Contributor

@mhuesch mhuesch commented Aug 15, 2018

Description

As a first step for CDEC-500, factor out shared example datatypes, so that
I can add Address tests without duplicating code.

Commit message:

The `Bi` & `Json` modules had a number of datatypes which were shared
and could be factored out. This commit pulls them out into the
`ExampleHelpers` module.

I currently import the `ExampleHelpers` unqualified and without an
import list - this goes against the guidelines but seems ok to me in a
test module.

Linked issue

https://iohk.myjetbrains.com/youtrack/issue/CDEC-500

Type of change

  • [~] 🐞 Bug fix (non-breaking change which fixes an issue)
  • [~] 🛠 New feature (non-breaking change which adds functionality)
  • [~] ⚠️ Breaking change (fix or feature that would cause existing functionality to change)
  • 🏭 Refactoring that does not change existing functionality but does improve things like code readability, structure etc
  • [~] 🔨 New or improved tests for existing code
  • [~] ⛑ git-flow chore (backport, hotfix, etc)

Developer checklist

  • I have read the style guide document, and my code follows the code style of this project.
  • If my code deals with exceptions, it follows the guidelines.
  • I have updated any documentation accordingly, if needed. Documentation changes can be reflected in opening a PR on cardanodocs.com, amending the inline Haddock comments, any relevant README file or one of the document listed in the docs directory.
  • [~] CHANGELOG entry has been added and is linked to the correct PR on GitHub.
    ^ this is a minor PR; not putting it in the CHANGELOG.

Testing checklist

  • [~] I have added tests to cover my changes.
  • All new and existing tests passed.
    ^ refactoring, so existing tests should verify correctness.

@mhuesch mhuesch self-assigned this Aug 15, 2018
@mhuesch mhuesch force-pushed the mhuesch/CDEC-500-1 branch 4 times, most recently from 0e17500 to 22c976e Compare August 15, 2018 04:04
The `Bi` & `Json` modules had a number of datatypes which were shared
and could be factored out. This commit pulls them out into the
`ExampleHelpers` module.
Copy link
Member

@erikd erikd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@@ -1,106 +1,74 @@
{-# LANGUAGE OverloadedStrings #-}
module Test.Pos.Core.Bi
( tests

-- Example data
, exampleBlockVersion
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯

Copy link
Contributor

@Jimbo4350 Jimbo4350 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good move, LGTM

@mhuesch mhuesch merged commit 6a73bb5 into develop Aug 15, 2018
@mhuesch mhuesch deleted the mhuesch/CDEC-500-1 branch August 15, 2018 11:42
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants