objectionary / eo-hamcrest Goto Github PK
View Code? Open in Web Editor NEWHamcrest Matchers for EO Programming Language
License: MIT License
Hamcrest Matchers for EO Programming Language
License: MIT License
The puzzle 41-bf856ca9
from #41 has to be resolved:
The puzzle was created by graur on 14-Sep-22.
Estimate: 30 minutes, role: DEV.
If you have any technical questions, don't ask me, submit new tickets instead. The task will be "done" when the problem is fixed and the text of the puzzle is removed from the source code. Here is more about PDD and about me.
Since 0.23.7 the way we work with memory
has changed. Now, we should do it like this:
memory 0 > x
x.write 42
We should update the version of EO in this lib and release again.
We need to up eo
version and fix bugs.
This is my code:
[] > delayed-calculation
memory 0 > m
[x] > inc
seq > @
m.write (m.plus x)
m
assert-that > @
inc
inc
inc
inc
1
$.equal-to 5
I'm getting:
[ERROR] EOdelayed_calculationTest.testWorks:100
Expected: <5> equal to value
but: was <5>
This is a pretty weird error message. How come 5 is not equal to 5?
Here: https://github.com/hamcrest/hamcrest.github.com
Let's submit a pull request there. Maybe they will accept (even though Kotlin is waiting since 2016 :)
In next version of eo reduce wii be reduced, reducei will be reduced
We need to implement several main matchers, according to description in README.md file.
We need more test to check how failed messages are look like
e.g.
[] > equal-to-int-failed-output
[] > suggestion
assert-that > @
4
$.equal-to 9
eq. > @
suggestion
"\nExpected: <9> equal to value\n but: was <4>"
We need to fix description in first block. Also we need to add examples in /examples folder. And fix badges
We need to create assert-that.eo
object in org.eolang.hamcrest.
package. Which will be the main object for our hamcrest library.
Usage:
+package org.eolang
+alias org.eolang.hamcrest.assert-that
+junit
[] > first-test
assert-that > @
"sum of two numbers"
4.add 4
.equal-to 8
.or
.less-than 50
The puzzle 37-c8e2717e
from #37 has to be resolved:
eo-hamcrest/src/main/eo/org/eolang/hamcrest/assert-that.eo
Lines 281 to 284 in 7309fc0
The puzzle was created by Graur Andrew on 12-Jun-22.
Estimate: 30 minutes, role: DEV.
If you have any technical questions, don't ask me, submit new tickets instead. The task will be "done" when the problem is fixed and the text of the puzzle is removed from the source code. Here is more about PDD and about me.
The puzzle 41-17873f95
from #41 has to be resolved:
The puzzle was created by graur on 14-Sep-22.
Estimate: 30 minutes, role: DEV.
If you have any technical questions, don't ask me, submit new tickets instead. The task will be "done" when the problem is fixed and the text of the puzzle is removed from the source code. Here is more about PDD and about me.
See GitHub Actions. It happens in some other EO libs. Maybe you can fix it.
is-empty
attributes has been recently moved to collections.list
object.
However the lib still tries to use it in array:
# Main object for assertions
[actual matcher reasons...] > assert-that
if. > @
matcher.match actual
TRUE
sprintf
"%s\nExpected: %s\n but: %s"
if.
reasons.is-empty
...
assert-that
object needs to be updated.
We should add package-info.java
to src/main/java/org/eolang/hamcrest
directory and release a new version of the library. Without this file, EO runtime can't detect org.eolang.hamcrest
as a package. It thinks it's a class.
Current version of eo-hamcrest is not compatible with EO 0.23.6, because it uses char
object, while it was removed in the latest EO.
[] > some-test
"abc" > a!
assert-that > @
a
$.equal-to "abd"
Should return FALSE when comparing different strings, but instead it freezes.
I had to remove eo-hamcrest from objectionary/home, since it's not compatible with 0.23.11. Please, fix the library, release it, and submit it to objectionary in a pull request.
arrays are converted to String
by .toString()
method, which renders them unreadable
Example:
Expected: <Hello, друг!
> equal to value
but: was <[B@3a7e45e7>
Proposal: use Arrays.toString()
instead
The puzzle 41-fa7f45be
from #41 has to be resolved:
The puzzle was created by @Graur on 14-Sep-22.
Estimate: 30 minutes, role: DEV.
If you have any technical questions, don't ask me, submit new tickets instead. The task will be "done" when the problem is fixed and the text of the puzzle is removed from the source code. Here is more about PDD and about me.
The puzzle 41-e26c967d
from #41 has to be resolved:
The puzzle was created by @Graur on 14-Sep-22.
Estimate: 30 minutes, role: DEV.
If you have any technical questions, don't ask me, submit new tickets instead. The task will be "done" when the problem is fixed and the text of the puzzle is removed from the source code. Here is more about PDD and about me.
Since we got rid of object array.eq
from eo-runtime
we need to figure out how to compare arrays. And add some type checking.
Maybe equal-to
could be an atom?
I wasn't able to retrieve PDD puzzles from the code base and submit them to GitHub. If you think that it's a bug on our side, please submit it to [yegor256/0pdd](https://github.com/yegor256/0pdd/issues):
(): did not find expected key while parsing a block mapping at line 1 column 1
Please, copy and paste this stack trace to GitHub:
Psych::SyntaxError
(<unknown>): did not find expected key while parsing a block mapping at line 1 column 1
/app/vendor/ruby-2.6.0/lib/ruby/2.6.0/psych.rb:456:in `parse'
/app/vendor/ruby-2.6.0/lib/ruby/2.6.0/psych.rb:456:in `parse_stream'
/app/vendor/ruby-2.6.0/lib/ruby/2.6.0/psych.rb:390:in `parse'
/app/vendor/ruby-2.6.0/lib/ruby/2.6.0/psych.rb:349:in `safe_load'
/app/objects/git_repo.rb:54:in `config'
/app/objects/job_emailed.rb:37:in `rescue in proceed'
/app/objects/job_emailed.rb:34:in `proceed'
/app/objects/job_commiterrors.rb:36:in `proceed'
/app/objects/job_detached.rb:48:in `exclusive'
/app/objects/job_detached.rb:36:in `block in proceed'
/app/objects/job_detached.rb:36:in `fork'
/app/objects/job_detached.rb:36:in `proceed'
/app/0pdd.rb:366:in `block in <top (required)>'
Version 0.23.15 has been release to Objectionary. I had to remove eo-hamcrest, since it didn't compile. Please, release a new version and submit a PR to Objectionary
We need to implement several main matchers, according to description in README.md file.
Can this code use decorator?
eo-hamcrest/src/main/eo/org/eolang/hamcrest/assert-that.eo
Lines 221 to 234 in f8bb840
I am not an expert in EO, but I assume that it can be rewrite as:
[matcher] > is
matcher > @
[] > description-of
sprintf > @
"is %s"
description-of.
matcher
Let me know if I am wrong. If not, I can submit appropriate PR.
This code didn't work
[] > arrays-each-items-varargs-case
[els...] > vararr
assert-that > @
els.
vararr * 1
$.array-each
$.greater-than 0
The puzzle 41-cc70864f
from #41 has to be resolved:
The puzzle was created by @Graur on 14-Sep-22.
Estimate: 30 minutes, role: DEV.
If you have any technical questions, don't ask me, submit new tickets instead. The task will be "done" when the problem is fixed and the text of the puzzle is removed from the source code. Here is more about PDD and about me.
We need to implement several main matchers, according to description in README.md file.
When:
+package org.eolang.hamcrest
+alias org.eolang.hamcrest.assert-that
+junit
[] > all-of-numbers-test
assert-that > @
150.sub 50
$.all-of
$.equal-to 100
$.equal-to 100
"all of numbers conditions"
an error occuried: You can't overwrite X
associated with: objectionary/eo#623
The puzzle 17-30c88f18
from #17 has to be resolved:
eo-hamcrest/src/main/eo/org/eolang/hamcrest/assert-that.eo
Lines 253 to 255 in 7309fc0
The puzzle was created by Graur Andrew on 12-Jun-22.
Estimate: 45 minutes, role: DEV.
If you have any technical questions, don't ask me, submit new tickets instead. The task will be "done" when the problem is fixed and the text of the puzzle is removed from the source code. Here is more about PDD and about me.
We need to implement several main matchers, according to description in README.md file:
.equal-to-ignoring-case
- test string equality ignoring case
.equal-to-ignoring-white-space
- test string equality ignoring differences in runs of whitespace
.contains-string
, .ends-with
, .starts-with
- test string matching
Metas must be sorted alphabetically according to EO policy
When:
[] > test
assert-that > @
* 1 2 3
$.equal-to
* - 1 -2
then:
Expected: <[Lorg.eolang.Phi;@3bd323e9> equal to value but: was <[Lorg.eolang.Phi;@4ff8d125>
The following error occurs when matching fails:
Caused by: org.eolang.ExFailure: Attribute failure at:
list.is-empty≡EOorg.EOeolang.EOcollections.EOlist$EOis_emptyν2033691:{
▸order=[]
▸cached=NULL (hash=765284253)
ρ=EOorg.EOeolang.EOcollections.EOlistν24:{
▸order=[arr, is-empty, reducei, as-array, reduce, mapi, map, each, without, eq]
▸cached=NULL (hash=351028485)
ρ=Φ.org.eolang.collectionsS
σ=ΦS
}S
σ=EOorg.EOeolang.EOcollections.EOlistν24:{
▸order=[arr, is-empty, reducei, as-array, reduce, mapi, map, each, without, eq]
▸cached=NULL (hash=351028485)
ρ=Φ.org.eolang.collectionsS
σ=ΦS
}S
}[#0=EOorg.EOeolang.EOhamcrest.EOassert_thatν16:{
▸order=[actual, matcher, reasons, equal-to, not, all-of, any-of, greater-than, less-than, close-to, is, anything, described-as, has-item, has-items, array-each]
▸cached=NULL (hash=1213349904)
ρ=Φ.org.eolang.hamcrestS
σ=ΦS
}.reasons].if'[#0=EOorg.EOeolang.EOstringν25:{
▸order=[eq, length, as-bytes, as-hash, slice]
▸cached=NULL (hash=1259769769)
Δ=ΦSF
ρ=ΦS
σ=ΦS
}[Δ=""]][#1=EOorg.EOeolang.EOhamcrest.EOassert_thatν16:{
▸order=[actual, matcher, reasons, equal-to, not, all-of, any-of, greater-than, less-than, close-to, is, anything, described-as, has-item, has-items, array-each]
▸cached=NULL (hash=1213349904)
ρ=Φ.org.eolang.hamcrestS
σ=ΦS
}.reasons.at'[#0=EOorg.EOeolang.EOintν28:{
▸order=[eq, lt, lte, gt, gte, neg, plus, minus, times, div, as-bytes, as-hash]
▸cached=NULL (hash=444920847)
Δ=ΦSF
ρ=ΦS
σ=ΦS
}[Δ=0]]]
When junit test return string description (instead of false) we expect a readable message but got cannot cast java.lang.String to java.lang.Boolean
, e.g.:
+package org.eolang.hamcrest
+alias org.eolang.hamcrest.assert-that
+junit
[] > two-numbers
assert-that > @
3.add 1
$.equal-to 8
"two numbers"
Expected console output message is something like:
two numbers
Expected: <8> but was <4>
Let's add +home
and +version
metas in all files, as it's done, for example, here: https://github.com/objectionary/eo/blob/master/eo-runtime/src/main/eo/org/eolang/bool.eo#L24-L25
We need to implement several main matchers, according to description in README.md file.
The puzzle 3-30c88f18
from #3 has to be resolved:
eo-hamcrest/src/main/eo/org/eolang/hamcrest/assert-that.eo
Lines 256 to 258 in f4ffbf4
The puzzle was created by @Graur on 18-Jul-22.
Estimate: 45 minutes, role: DEV.
If you have any technical questions, don't ask me, submit new tickets instead. The task will be "done" when the problem is fixed and the text of the puzzle is removed from the source code. Here is more about PDD and about me.
We need to implement several main matchers, according to description in README.md file.
Yaml found at: .github/workflows/codecov.yml
-> Found 1 reports
==> Detecting git/mercurial file structure
==> Reading reports
- file not found at ./eo-parser/target/site/jacoco/jacoco.xml
--> No coverage data found.
Please visit http://docs.codecov.io/docs/supported-languages
search for your projects language to learn how to collect reports.
Error: Codecov failed with the following error: The process '/usr/bin/bash' failed with exit code 1
Moved from here.
Test below test fails with stack overflow:
[] > invalid-test
assert-that > @
TRUE
$.equals-to TRUE
[ERROR] EOorg.EOeolang.EOinvalid_testTest.testWorks Time elapsed: 0.01 s <<< ERROR!
java.lang.StackOverflowError
[ERROR] EOinvalid_testTest>PhDefault.attr:237->PhDefault.attr:237->PhDefault.attr:237->PhDefault.attr:237->PhDefault.attr:237->PhDefault.attr:237->PhDefault.attr:237->PhDefault.attr:237->PhDefault.attr:237->PhDefault.attr:237->PhDefault.attr:237->PhDefault.attr:237->PhDefault.attr:237->PhDefault.attr:237->PhDefault.attr:237->PhDefault.attr:237->PhDefault.attr:237->PhDefault.attr:237->PhDefault.attr:237->PhDefault.attr:237->PhDefault.attr:237->PhDefault.attr:237->PhDefault.attr:237->PhDefault.attr:237->PhDefault.attr:237->PhDefault.attr:237->PhDefault.attr:237->PhDefault.attr:237->PhDefault.attr:237->PhDefault.attr:237->PhDefault.attr:237->PhDefault.attr:237->PhDefault.attr:237->PhDefault.attr:237->PhDefault.attr:237->PhDefault.attr:237->PhDefault.attr:237->PhDefault.attr:237->PhDefault.attr:237->PhDefault.attr:237->PhDefault.attr:237->PhDefault.attr:237->PhDefault.attr:237->PhDefault.attr:237->PhDefault.attr:237->PhDefault.attr:237->PhDefault.attr:237->PhDefault.attr:237 » StackOverflow
Expected behaviour: something like Can't get(), attribute "equals-to" is absent among other attrs (ρ, minus, σ, lt, eq, gt, as-hash, plus, div, neg, times, Δ, as-bytes, gte, lte) and φ is absent
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.