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

feat(*): bump concerto, metadata versions #15

Merged
merged 1 commit into from
May 23, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
176 changes: 120 additions & 56 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@
"tmp-promise": "3.0.2"
},
"dependencies": {
"@accordproject/concerto-analysis": "3.7.0",
"@accordproject/concerto-codegen": "3.9.1",
"@accordproject/concerto-core": "3.7.0",
"@accordproject/concerto-cto": "3.7.0",
"@accordproject/concerto-metamodel": "3.7.0",
"@accordproject/concerto-util": "3.7.0",
"@accordproject/concerto-analysis": "3.8.1",
"@accordproject/concerto-codegen": "3.10.0",
"@accordproject/concerto-core": "3.8.1",
"@accordproject/concerto-cto": "3.8.1",
"@accordproject/concerto-metamodel": "3.8.0",
"@accordproject/concerto-util": "3.8.1",
"ansi-colors": "4.1.3",
"glob": "^7.2.0",
"randexp": "^0.5.3",
Expand Down
14 changes: 14 additions & 0 deletions test/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
'use strict';

const chai = require('chai');
const expect = chai.expect;
const path = require('path');
const tmp = require('tmp-promise');
const fs = require('fs');
Expand Down Expand Up @@ -667,5 +668,18 @@ describe('concerto-cli', () => {
);
(typeof obj.ssn).should.equal('string');
});

it('should generate an string values within the given length range', async () => {
const obj = await Commands.generate(
offlineModels,
'[email protected]',
'sample',
{ offline: true, optionalFields: true }
);
expect(obj.lastName.length >= 1).to.be.true;
expect(obj.lastName.length <= 10).to.be.true;
expect(obj.firstName.length <= 10).to.be.true;
expect(obj.fatherName.length >= 1).to.be.true;
});
});
});
3 changes: 3 additions & 0 deletions test/models/person.cto
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ namespace [email protected]

concept Person identified by ssn {
o String name
o String firstName length=[,10]
o String lastName length=[1,10]
o String fatherName length=[1,]
@description("Height (cm)")
o Double height range=[0.0,]
o DateTime dateOfBirth
Expand Down