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

chore(aliasing): tests import aliasing #977

Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,129 changes: 670 additions & 459 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"devDependencies": {
"@types/jest": "^29.5.14",
"dayjs": "1.11.13",
"glob": "^7.2.0",
"glob": "^11.0.1",
"license-check-and-add": "4.0.5",
"nyc": "17.1.0",
"semver": "7.6.3"
Expand Down
2 changes: 1 addition & 1 deletion packages/concerto-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
},
"dependencies": {
"@accordproject/concerto-cto": "3.20.1",
"@accordproject/concerto-metamodel": "3.10.4",
"@accordproject/concerto-metamodel": "3.11.0",
"@accordproject/concerto-util": "3.20.1",
"dayjs": "1.11.13",
"debug": "4.3.7",
Expand Down
7 changes: 7 additions & 0 deletions packages/concerto-core/test/data/aliasing/child.cto
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace [email protected]

concept Child {
o Integer age
}

scalar MyString extends String
24 changes: 24 additions & 0 deletions packages/concerto-core/test/data/aliasing/parent.cto
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
@test(Kid)
namespace [email protected]

import [email protected].{MyString as Str,Child as Kid}
Copy link
Member

Choose a reason for hiding this comment

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

Perhaps it's jet lag, but I find these examples hard to parse. Let's give the identifiers more descriptive names to make the tests easier to understand.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done!


@test(Kid)
concept Child extends Kid {
@test(Kid)
o Kid kid
o Str str
}

concept Student extends Child {
o Str schoolName
o Str name
o Child myChild
}

@test(Kid)
map KidIndex {
o Str
@test(Kid)
o Kid
}
Loading
Loading