Skip to content

Commit

Permalink
feat(*): bump concerto, metadata versions (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
ragi-dayananda authored May 23, 2023
1 parent b2f5080 commit 625816e
Show file tree
Hide file tree
Showing 4 changed files with 143 additions and 62 deletions.
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

0 comments on commit 625816e

Please sign in to comment.