File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change 1
1
const tape = require ( 'tape' ) ;
2
2
const solc = require ( '../index.js' ) ;
3
3
4
+ tape ( 'Version and license' , function ( t ) {
5
+ t . test ( 'check version' , function ( st ) {
6
+ st . equal ( typeof solc . version ( ) , 'string' ) ;
7
+ st . end ( ) ;
8
+ } ) ;
9
+ t . test ( 'check license' , function ( st ) {
10
+ st . ok ( typeof solc . license ( ) === 'undefined' || typeof solc . license ( ) === 'string' ) ;
11
+ st . end ( ) ;
12
+ } ) ;
13
+ } ) ;
14
+
4
15
tape ( 'Compilation' , function ( t ) {
5
16
t . test ( 'single files can be compiled' , function ( st ) {
6
17
var output = solc . compile ( 'contract x { function g() {} }' ) ;
Original file line number Diff line number Diff line change @@ -178,8 +178,17 @@ function setupMethods (soljson) {
178
178
179
179
var version = soljson . cwrap ( 'version' , 'string' , [ ] ) ;
180
180
181
+ var license = function ( ) {
182
+ // return undefined
183
+ } ;
184
+
185
+ if ( '_license' in soljson ) {
186
+ license = soljson . cwrap ( 'license' , 'string' , [ ] ) ;
187
+ }
188
+
181
189
return {
182
190
version : version ,
191
+ license : license ,
183
192
compile : compile ,
184
193
compileStandard : compileStandard ,
185
194
compileStandardWrapper : compileStandardWrapper ,
You can’t perform that action at this time.
0 commit comments