forked from wvlet/airframe
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test for Enumeration support (wvlet#3411)
- Loading branch information
1 parent
a7a8828
commit ff20874
Showing
1 changed file
with
35 additions
and
0 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
airframe-surface/src/test/scala/wvlet/airframe/surface/i3411.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package wvlet.airframe.surface | ||
|
||
import wvlet.airspec.AirSpec | ||
|
||
object i3411 extends AirSpec { | ||
|
||
object SomeEnum extends Enumeration { | ||
type SomeEnum = Value | ||
|
||
val A, B, C = Value | ||
} | ||
|
||
import SomeEnum.SomeEnum | ||
|
||
test("Handle a Scala 2 enumeration") { | ||
val s = Surface.of[SomeEnum] // just check there is no error - no expected properties | ||
val m = Surface.methodsOf[SomeEnum] | ||
debug(s.params) | ||
// enumeration type (value) usually contains at least the compare method | ||
m.map(_.name) shouldContain "compare" | ||
} | ||
} |