Skip to content

Commit

Permalink
Merge pull request #98 from gnikit/feature/unittest-upgrade
Browse files Browse the repository at this point in the history
Restructures signature help tests and adds intrinsic test
  • Loading branch information
gnikit authored Apr 29, 2022
2 parents ea283f2 + cd080dd commit d73fc67
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 1 deletion.
12 changes: 11 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
# CHANGELONG

## 2.2.14

### Added

- Added unittests for intrinsics and improved overall coverage

### Changed

- Restructured unittests to individual files for more granular reporting

## 2.2.13

### Added

- Automated the update for GitHub Acions
- Automated the update for GitHub Actions

## 2.2.12

Expand Down
1 change: 1 addition & 0 deletions test/test_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ def check_return(result_array):
["test_inherit", 2, 0],
["test_int", 2, 0],
["test_mod", 2, 0],
["test_nan", 2, 0],
["test_nonint_mod", 2, 0],
["test_preproc_keywords", 2, 0],
["test_private", 2, 8],
Expand Down
18 changes: 18 additions & 0 deletions test/test_server_signature_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,21 @@ def test_subroutine_signature_help():
assert len(ref) == len(results) - 1
for i, r in enumerate(ref):
validate_sigh(results[i + 1], r)


def test_intrinsics():

string = write_rpc_request(
1, "initialize", {"rootPath": str(test_dir / "signature")}
)
file_path = test_dir / "signature" / "nested_sigs.f90"
string += sigh_request(file_path, 8, 77)
errcode, results = run_request(
string, ["--hover_signature", "--use_signature_help", "-n", "1"]
)
assert errcode == 0

ref = [[0, 2, "REAL(A, KIND=kind)"]]
assert len(ref) == len(results) - 1
for i, r in enumerate(ref):
validate_sigh(results[i + 1], r)
10 changes: 10 additions & 0 deletions test/test_source/signature/nested_sigs.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
program test_nan
use, intrinsic :: iso_fortran_env, only: sp=>real32, dp=>real64, qp=>real128
use, intrinsic :: ieee_arithmetic, only: ieee_value, ieee_quiet_nan, ieee_is_nan
implicit none

complex(qp) :: nan_zp

nan_zp = ieee_value(1.,ieee_quiet_nan)
print '(A4,2X,F5.1,6X,L1,2X,Z32)','zp',real(nan_zp), ieee_is_nan(real(nan_zp)),nan_zp
end program test_nan

0 comments on commit d73fc67

Please sign in to comment.