Skip to content

Commit

Permalink
Adding rating tests
Browse files Browse the repository at this point in the history
  • Loading branch information
filipebraida committed Oct 27, 2019
1 parent ade1968 commit ae75490
Showing 1 changed file with 32 additions and 1 deletion.
33 changes: 32 additions & 1 deletion test/ratingTest.jl
Expand Up @@ -162,6 +162,18 @@
@test_throws Exception databaseRating >= rating
@test_throws Exception rating >= predictRating
@test_throws Exception rating >= databaseRating

@test_throws Exception rating + rating
@test_throws Exception rating - rating
@test_throws Exception rating * rating
@test_throws Exception rating / rating

@test_throws Exception rating == rating
@test_throws Exception rating != rating
@test_throws Exception rating > rating
@test_throws Exception rating < rating
@test_throws Exception rating >= rating
@test_throws Exception rating <= rating
end

@testset "Operations with Rating" begin
Expand All @@ -177,10 +189,29 @@
for f in functions
@test o(rating, f(preference)) == o(value, f(preference))
@test o(f(preference), rating) == o(f(preference), value)

end
end

@test (rating > value) == false
@test (rating >= value) == true
@test (rating < value) == false
@test (rating <= value) == true
@test (rating == value) == true
@test (rating != value) == false

@test (value > rating) == false
@test (value >= rating) == true
@test (value < rating) == false
@test (value <= rating) == true
@test (value == rating) == true
@test (value != rating) == false

@test (rating > rating) == false
@test (rating < rating) == false
@test (rating >= rating) == true
@test (rating <= rating) == true
@test (rating == rating) == true
@test (rating != rating) == false
end
end
end

2 comments on commit ae75490

@filipebraida
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register

Release notes:

  • New operations with ratings

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request updated: JuliaRegistries/General/4401

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if Julia TagBot is installed, or can be done manually through the github interface, or via:

git tag -a v0.1.2 -m "<description of version>" ae754905a203ae40ff52ee097a3f651981603ebe
git push origin v0.1.2

Please sign in to comment.