Skip to content

Commit 08f2434

Browse files
author
SReject
committed
Updated tests
1 parent 537f5bb commit 08f2434

1 file changed

Lines changed: 21 additions & 21 deletions

File tree

test/JSON for mIRC - Tests.mrc

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ alias -l jfm_test {
2121
var %testnum = 0
2222
var %err
2323
var %res
24-
var %cert_url
25-
var %cert_re
2624
var %echo = echo 03 -sgi6 $!+([#,$base(%testNum,10,10,3),])
2725

2826
;;============================;;
@@ -1194,24 +1192,6 @@ alias -l jfm_test {
11941192
;; ;;
11951193
;;==============================;;
11961194

1197-
;; (slv) Added Test: Attempt to use invalid SSL cert with/without i switch
1198-
%cert_url = https://self-signed.badssl.com
1199-
%cert_re = /^The certificate authority is invalid or incorrect/
1200-
inc %testnum
1201-
JSONOpen -u jfm_test %cert_url
1202-
if (!$regex($JSONError,%cert_re)) {
1203-
return %testnum /JSONOpen -u %cert_url : Request reported unexpected error: $v2
1204-
}
1205-
$(%echo,2) /JSONOpen -u %cert_url : Passed Check
1206-
JSONClose jfm_test
1207-
inc %testnum
1208-
JSONOpen -ui jfm_test %cert_url
1209-
if ($regex($JSONError,%cert_re)) {
1210-
return %testnum /JSONOpen -ui %cert_url : Request reported error: $v2
1211-
}
1212-
$(%echo,2) /JSONOpen -ui %cert_url : Request succeeded
1213-
JSONClose jfm_test
1214-
12151195
;; Attempt to retrieve data from a remote source
12161196
inc %testnum
12171197
JSONOpen -u jfm_test http://echo.jsontest.com/key/value
@@ -1221,7 +1201,7 @@ alias -l jfm_test {
12211201
}
12221202
return %testnum /JSONOpen -u : Request reported error: $v2
12231203
}
1224-
$(%echo,2) /JSONOpen -u : Request succeeded
1204+
$(%echo,2) /JSONOpen -u : Passed Check
12251205

12261206
;; Check to make sure the parsed json can be accessed
12271207
inc %testnum
@@ -1344,6 +1324,26 @@ alias -l jfm_test {
13441324

13451325
JSONClose jfm_test
13461326

1327+
;; Attempt to use invalid SSL cert without i switch
1328+
var %cert_url = https://self-signed.badssl.com
1329+
var %cert_re = /^The certificate authority is invalid or incorrect/
1330+
inc %testnum
1331+
JSONOpen -u jfm_test %cert_url
1332+
if (!$regex($JSONError, %cert_re)) {
1333+
return %testnum /JSONOpen -u %cert_url : Request reported unexpected error: $v2
1334+
}
1335+
$(%echo,2) /JSONOpen -u %cert_url : Passed Check
1336+
JSONClose jfm_test
1337+
1338+
;; Attempt to use invalid SSL cert with i switch
1339+
inc %testnum
1340+
JSONOpen -ui jfm_test %cert_url
1341+
if ($regex($JSONError, %cert_re)) {
1342+
return %testnum /JSONOpen -ui %cert_url : Request reported error: $v2
1343+
}
1344+
$(%echo,2) /JSONOpen -ui %cert_url : Passed Check
1345+
JSONClose jfm_test
1346+
13471347
}
13481348

13491349

0 commit comments

Comments
 (0)