Skip to content

Commit

Permalink
Merge pull request #41 from 2fd/feat/regex-1.9
Browse files Browse the repository at this point in the history
feat: update regex to 1.9
  • Loading branch information
2fd authored Dec 15, 2023
2 parents 80f81c3 + 93620a6 commit 7dc6e32
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 7 deletions.
1 change: 1 addition & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
pull_request:
branches:
- master
- 1.8.x
- 1.7.x
- 1.6.x
- 1.5.x
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- master
- 1.8.x
- 1.7.x
- 1.6.x
- 1.5.x
Expand Down
18 changes: 15 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "rregex"
description = "Rust Regex binding for Javascript"
license = "MIT"
version = "1.8.0"
version = "1.9.0"
authors = [ "Fede Ramirez <[email protected]>" ]
publish = false
readme = "README.md"
Expand All @@ -11,7 +11,7 @@ homepage = "http://rregex.dev"
repository = "https://github.com/2fd/rregex"

[dependencies]
regex = "~1.8"
regex = "~1.9"
regex-syntax = "0.7"
js-sys = "0.3"
wasm-bindgen = "0.2"
Expand Down
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@
"range": "1.7.x",
"channel": "1.7.x"
},
{
"name": "1.8.x",
"range": "1.8.x",
"channel": "1.8.x"
},
{
"name": "master"
}
Expand Down
32 changes: 30 additions & 2 deletions test/rregex.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ describe(`RRegex`, () => {
const re4 = new RRegex("(?<a>.(?<b>.))(.)(?:.)(?<c>.)")
expect(re4.capturesLength()).toEqual(5)

// const re5 = new RRegex("[a&&b]")
// expect(re5.capturesLength()).toEqual(1)
const re5 = new RRegex("[a&&b]")
expect(re5.capturesLength()).toEqual(1)
})

test(`captureNames`, () => {
Expand Down Expand Up @@ -1005,6 +1005,34 @@ describe(`RRegex`, () => {
}
})
})


test('Empty character class', () => {
const regex = new RRegex('[a&&b]')
expect(regex.syntax()).toEqual({
"@name": "regex_syntax::hir::Hir",
"@type": "struct",
"kind": {
"@name": "regex_syntax::hir::HirKind",
"@type": "enum",
"@variant": "Class",
"@values": [
{
"@name": "regex_syntax::hir::Class",
"@type": "enum",
"@variant": "Bytes",
"@values": [
{
"@name": "regex_syntax::hir::ClassBytes",
"@type": "struct",
"ranges": []
}
]
}
],
}
})
})
})
})

Expand Down

0 comments on commit 7dc6e32

Please sign in to comment.