import * as assert from 'assert' ; import * as vscode from 'vscode' ; import * as utils from '../src/crystalUtils' ; import { isNotKeyword } from '../src/crystalUtils' ; var config = vscode . workspace . getConfiguration ( "crystal-lang" ) ; suite ( "Common Utils" , ( ) => { test ( "Concurrent class" , ( ) => { assert . equal ( utils . Concurrent . counter , 0 ) ; utils . Concurrent . counter += 1 ; assert . equal ( utils . Concurrent . counter , 1 ) ; assert . equal ( utils . Concurrent . limit ( ) , 3 ) ; assert . equal ( utils . Concurrent . limit ( ) > utils . Concurrent . counter , true ) ; utils . Concurrent . counter += 2 ; assert . equal ( utils . Concurrent . counter , 3 ) ; assert . equal ( utils . Concurrent . limit ( ) > utils . Concurrent . counter , false ) ; } ) ; test ( "Verify keywords" , ( ) => { assert . equal ( utils . isNotKeyword ( "def" ) , false ) ; assert . equal ( utils . isNotKeyword ( "foo" ) , true ) ; } ) ; test ( "Verify libs" , ( ) => { assert . equal ( utils . isNotLib ( "/foo/bar" ) , true ) ; assert . equal ( utils . isNotLib ( "lib" ) , false ) ; } ) ; } ) ;