File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change 1
1
import * as path from 'path' ;
2
2
import * as assert from 'assert' ;
3
- import { shellTask , spawnAsPromise } from '../src/lib/tools' ;
3
+ import { Uri } from 'vscode' ;
4
+ import { shellTask , spawnAsPromise , pathRelToAbs } from '../src/lib/tools' ;
4
5
5
6
suite ( 'Tools tests' , ( ) => {
6
7
test ( 'shellTask returns correct output' , async ( ) => {
@@ -49,4 +50,15 @@ suite('Tools tests', () => {
49
50
assert . strictEqual ( stdout , 'Hello World!' ) ;
50
51
assert . strictEqual ( stderr , 'Errors' ) ;
51
52
} ) ;
53
+
54
+ test ( 'Resolve local paths: default workspace' , ( ) => {
55
+ const absPath = pathRelToAbs ( './sample.f90' ) ;
56
+ assert . strictEqual ( absPath , path . resolve ( __dirname , '../../test/fortran/sample.f90' ) ) ;
57
+ } ) ;
58
+
59
+ test ( 'Resolve local paths: workspace selection' , ( ) => {
60
+ const root = Uri . parse ( path . resolve ( __dirname , '../../test/fortran' ) ) ;
61
+ const absPath = pathRelToAbs ( './sample.f90' , root ) ;
62
+ assert . strictEqual ( absPath , path . resolve ( __dirname , '../../test/fortran/sample.f90' ) ) ;
63
+ } ) ;
52
64
} ) ;
You can’t perform that action at this time.
0 commit comments