Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add unit tests for internal packages #43

Merged
merged 4 commits into from
May 2, 2024
Merged

add unit tests for internal packages #43

merged 4 commits into from
May 2, 2024

Conversation

ugwis
Copy link
Member

@ugwis ugwis commented May 2, 2024

Issue #40 , if available:

Description of changes:

  • some fix error handling
  • add tests

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@ugwis
Copy link
Member Author

ugwis commented May 2, 2024

$ go test -v ./...
?   	github.com/awslabs/diagram-as-code/cmd/awsdac	[no test files]
?   	github.com/awslabs/diagram-as-code/internal/ctl	[no test files]
?   	github.com/awslabs/diagram-as-code/internal/font	[no test files]
=== RUN   TestFetchFile
--- PASS: TestFetchFile (0.00s)
=== RUN   TestExtractZipFile
--- PASS: TestExtractZipFile (0.00s)
PASS
ok  	github.com/awslabs/diagram-as-code/internal/cache	(cached)
=== RUN   TestDefinitionStructure_LoadDefinitions
=== RUN   TestDefinitionStructure_LoadDefinitions/Valid_YAML_file
--- PASS: TestDefinitionStructure_LoadDefinitions (0.00s)
    --- PASS: TestDefinitionStructure_LoadDefinitions/Valid_YAML_file (0.00s)
=== RUN   TestDefinition
=== RUN   TestDefinition/ValidDefinition
=== RUN   TestDefinition/NestedDefinition
--- PASS: TestDefinition (0.00s)
    --- PASS: TestDefinition/ValidDefinition (0.00s)
    --- PASS: TestDefinition/NestedDefinition (0.00s)
PASS
ok  	github.com/awslabs/diagram-as-code/internal/definition	(cached)
=== RUN   TestGroupInit
--- PASS: TestGroupInit (0.00s)
=== RUN   TestGroupLoadIcon
--- PASS: TestGroupLoadIcon (0.00s)
=== RUN   TestGroupSetters
--- PASS: TestGroupSetters (0.00s)
=== RUN   TestGroupAddLink
--- PASS: TestGroupAddLink (0.00s)
=== RUN   TestGroupAddChild
--- PASS: TestGroupAddChild (0.00s)
=== RUN   TestGroupScale
time="2024-05-02T14:37:33+09:00" level=info msg="Scale "
--- PASS: TestGroupScale (0.00s)
=== RUN   TestHorizontalStackInit
--- PASS: TestHorizontalStackInit (0.00s)
=== RUN   TestLinkInit
--- PASS: TestLinkInit (0.00s)
=== RUN   TestGetThreeSide
--- PASS: TestGetThreeSide (0.00s)
=== RUN   TestDrawNeighborsDots1
--- PASS: TestDrawNeighborsDots1 (0.00s)
=== RUN   TestDrawNeighborDots2
--- PASS: TestDrawNeighborDots2 (0.00s)
=== RUN   TestResource
--- PASS: TestResource (0.16s)
=== RUN   TestMaxInt
=== RUN   TestMaxInt/positive_numbers
=== RUN   TestMaxInt/negative_numbers
=== RUN   TestMaxInt/equal_numbers
--- PASS: TestMaxInt (0.00s)
    --- PASS: TestMaxInt/positive_numbers (0.00s)
    --- PASS: TestMaxInt/negative_numbers (0.00s)
    --- PASS: TestMaxInt/equal_numbers (0.00s)
=== RUN   TestMinInt
=== RUN   TestMinInt/positive_numbers
=== RUN   TestMinInt/negative_numbers
=== RUN   TestMinInt/equal_numbers
--- PASS: TestMinInt (0.00s)
    --- PASS: TestMinInt/positive_numbers (0.00s)
    --- PASS: TestMinInt/negative_numbers (0.00s)
    --- PASS: TestMinInt/equal_numbers (0.00s)
=== RUN   TestFetchColor
=== RUN   TestFetchColor/opaque_color
=== RUN   TestFetchColor/transparent_color
--- PASS: TestFetchColor (0.00s)
    --- PASS: TestFetchColor/opaque_color (0.00s)
    --- PASS: TestFetchColor/transparent_color (0.00s)
=== RUN   TestBlendColor
=== RUN   TestBlendColor/opaque_colors
=== RUN   TestBlendColor/transparent_colors
--- PASS: TestBlendColor (0.00s)
    --- PASS: TestBlendColor/opaque_colors (0.00s)
    --- PASS: TestBlendColor/transparent_colors (0.00s)
=== RUN   TestCalcPosition
=== RUN   TestCalcPosition/center
=== RUN   TestCalcPosition/invalid_position
--- PASS: TestCalcPosition (0.00s)
    --- PASS: TestCalcPosition/center (0.00s)
    --- PASS: TestCalcPosition/invalid_position (0.00s)
=== RUN   TestVerticalStackInit
--- PASS: TestVerticalStackInit (0.00s)
PASS
ok  	github.com/awslabs/diagram-as-code/internal/types	0.756s

@ugwis ugwis merged commit fd9deeb into awslabs:main May 2, 2024
@ugwis ugwis mentioned this pull request May 2, 2024
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant