FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
SRL-JavaScript/test/exceptions-test.js at master · AuxControl/SRL-JavaScript · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
AuxControl
/
SRL-JavaScript
Public
forked from
SimpleRegex/SRL-JavaScript
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
SRL-JavaScript
/
test
/
exceptions-test.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
36 lines (28 loc) · 1 KB
Breadcrumbs
SRL-JavaScript
/
test
/
exceptions-test.js
Copy path
File metadata and controls
36 lines (28 loc) · 1 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
'use strict'
const
assert
=
require
(
'assert'
)
const
SRL
=
require
(
'../'
)
const
BuilderException
=
require
(
'../lib/Exceptions/Builder'
)
const
ImplementationException
=
require
(
'../lib/Exceptions/Implementation'
)
describe
(
'Builder Exceptions'
,
(
)
=>
{
it
(
'Raw method'
,
(
)
=>
{
const
regex
=
new
SRL
(
'Literally "a"'
)
assert
[
'throws'
]
(
(
)
=>
{
regex
.
raw
(
')'
)
}
,
(
error
)
=>
{
return
error
instanceof
BuilderException
&&
error
.
message
===
'Adding raw would invalidate this regular expression. Reverted.'
&&
regex
.
test
(
'a'
)
}
)
}
)
}
)
describe
(
'Implementation Exception'
,
(
)
=>
{
it
(
'Lazy Method'
,
(
)
=>
{
const
regex
=
new
SRL
(
'Literally "a"'
)
assert
[
'throws'
]
(
(
)
=>
{
regex
.
lazy
(
)
}
,
(
error
)
=>
{
return
error
instanceof
ImplementationException
&&
error
.
message
===
'Cannot apply laziness at this point. Only applicable after quantifier.'
}
)
}
)
}
)
Back
|
FazBrowse Home
|
New Git URL