Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaqz committed Oct 22, 2023
1 parent ef25a46 commit 15c5f20
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions test/basic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ end;

# ## Implementation

import Interfaces as Intr
using Interfaces

# Now we implement the `AnimalInterface`, for a `Duck`.

Expand All @@ -65,11 +65,11 @@ Animals.talk(::Duck) = :quack
# We then test that the interface is correctly implemented

ducks = [Duck(1), Duck(2)]
Intr.test(Animals.AnimalInterface, Duck, ducks)
Interfaces.test(Animals.AnimalInterface, Duck, ducks)

# As well as two optional methods

Intr.test(Animals.AnimalInterface{(:walk,:talk)}, Duck, ducks)
Interfaces.test(Animals.AnimalInterface{(:walk,:talk)}, Duck, ducks)

#=
Finally we declare it, so that the information can be used in static dispatch.
Expand All @@ -79,7 +79,7 @@ The `@implements` macro takes two arguments.
2. The type for which the interface is implemented.
=#

Intr.@implements Animals.AnimalInterface{(:walk,:talk)} Duck
@implements Animals.AnimalInterface{(:walk,:talk)} Duck

# Now let's see what happens when the interface is not correctly implemented.
struct Chicken <: Animals.Animal end
Expand All @@ -92,7 +92,6 @@ catch e
print(e)
end


# The following tests are not included in the docs #src

using Test #src
Expand Down

0 comments on commit 15c5f20

Please sign in to comment.