parsecs 0.12.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/ext/libnativemath/extconf.rb +1 -1
- data/test/test_parsec.rb +34 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5abfe818972ad4f07089bc1d4a481a7c72bc8b5afb80ee490b3b7f5150f71e49
|
4
|
+
data.tar.gz: 6a10b41f9ebf29ce4a4d4acedee12bfd09695ecea764b597b7d9b8ef40c7d1a0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f2a8d47fa873fb8e8841cea8829d468ff06d7defeb5fb87d06e5432084b2609698550f483296252b11ae6de390cc40fe1cae842a963a293c76502af45e3e5d62
|
7
|
+
data.tar.gz: b5e0a321445cdddd9b771f7496490cd76c2a51e687b74fc0b83685eb98c4dc369b9958ff4925a41cb8331ff93f8f7e955d907764336223da9d8290627688eba6
|
@@ -38,7 +38,7 @@ libs.each do |lib|
|
|
38
38
|
end
|
39
39
|
|
40
40
|
GIT_REPOSITORY = 'https://github.com/oxeanbits/equations-parser.git'.freeze
|
41
|
-
COMMIT = '
|
41
|
+
COMMIT = 'b81e50bc4c43556f8d75566bf0f86a2e71a7ac4e'.freeze
|
42
42
|
|
43
43
|
Dir.chdir(BASEDIR) do
|
44
44
|
system('git init')
|
data/test/test_parsec.rb
CHANGED
@@ -338,4 +338,38 @@ class TestParsec < Minitest::Test
|
|
338
338
|
assert_equal('apple', parsec.eval_equation('regex("apple123redbanana", "(?=apple)([a-z]+)(?=\\\\d+red)")'))
|
339
339
|
assert_equal('apple', parsec.eval_equation('regex("apple123red456banana", "(?=apple)([a-z]+)(?=(\\\\d+red)\\\\d+banana)")'))
|
340
340
|
end
|
341
|
+
|
342
|
+
def test_weekyear
|
343
|
+
parsec = Parsec::Parsec
|
344
|
+
|
345
|
+
# Week number of the year when 1st of January is a Sunday
|
346
|
+
assert_equal(1, parsec.eval_equation('weekyear("2023-01-01")'))
|
347
|
+
assert_equal(1, parsec.eval_equation('weekyear("2023-01-07")'))
|
348
|
+
assert_equal(2, parsec.eval_equation('weekyear("2023-01-08")'))
|
349
|
+
|
350
|
+
assert_equal(17, parsec.eval_equation('weekyear("2023-04-25")'))
|
351
|
+
assert_equal(17, parsec.eval_equation('weekyear("2023-04-29")'))
|
352
|
+
assert_equal(18, parsec.eval_equation('weekyear("2023-04-30")'))
|
353
|
+
assert_equal(18, parsec.eval_equation('weekyear("2023-05-06")'))
|
354
|
+
|
355
|
+
assert_equal(52, parsec.eval_equation('weekyear("2023-12-24")'))
|
356
|
+
assert_equal(53, parsec.eval_equation('weekyear("2023-12-31")'))
|
357
|
+
|
358
|
+
# Week number of the year a leap year
|
359
|
+
assert_equal(1, parsec.eval_equation('weekyear("2024-01-01")'))
|
360
|
+
assert_equal(1, parsec.eval_equation('weekyear("2024-01-06")'))
|
361
|
+
assert_equal(2, parsec.eval_equation('weekyear("2024-01-07")'))
|
362
|
+
|
363
|
+
assert_equal(52, parsec.eval_equation('weekyear("2024-12-22")'))
|
364
|
+
assert_equal(53, parsec.eval_equation('weekyear("2024-12-29")'))
|
365
|
+
|
366
|
+
# Week number of the year when 1st of January is friday
|
367
|
+
assert_equal(53, parsec.eval_equation('weekyear("2027-01-01")'))
|
368
|
+
assert_equal(53, parsec.eval_equation('weekyear("2027-01-02")'))
|
369
|
+
assert_equal(1, parsec.eval_equation('weekyear("2027-01-03")'))
|
370
|
+
|
371
|
+
assert_equal(52, parsec.eval_equation('weekyear("2027-12-27")'))
|
372
|
+
assert_equal(52, parsec.eval_equation('weekyear("2027-12-31")'))
|
373
|
+
assert_equal(53, parsec.eval_equation('weekyear("2028-01-01")'))
|
374
|
+
end
|
341
375
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: parsecs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.13.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nilton Vasques
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2023-04-
|
13
|
+
date: 2023-04-25 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: minitest
|