2021-12-30 15:25:49 +01:00
|
|
|
#!/usr/bin/env julia
|
|
|
|
# -*- coding: UTF-8 -*-
|
|
|
|
# __julia-version__ = 1.7.0
|
|
|
|
# __author__ = "Martin Scheidt"
|
|
|
|
# __copyright__ = "2021"
|
|
|
|
# __license__ = "ISC"
|
|
|
|
|
|
|
|
include("../src/types.jl")
|
|
|
|
include("../src/Input.jl")
|
|
|
|
|
|
|
|
using .Input
|
|
|
|
using YAML, Test
|
|
|
|
|
2022-01-08 02:11:08 +01:00
|
|
|
@enum trainType passenger=1 freight=2 motorCoachTrain=3
|
2021-12-30 15:25:49 +01:00
|
|
|
|
2022-01-08 02:11:08 +01:00
|
|
|
@test Input.getEnum("passenger", trainType) == passenger::trainType
|
|
|
|
@test Input.getEnum("freight", trainType) == freight::trainType
|
|
|
|
@test Input.getEnum("motorCoachTrain", trainType) == motorCoachTrain::trainType
|
2021-12-30 15:25:49 +01:00
|
|
|
|
|
|
|
data = YAML.load(open("data/trains/train_passenger_IC2.yaml"))
|
2022-01-08 02:11:08 +01:00
|
|
|
@test Input.getEnum(data["train"]["trainType"], trainType) == passenger::trainType
|
2021-12-30 15:25:49 +01:00
|
|
|
|
|
|
|
data = YAML.load(open("data/trains/train_freight_V90withOreConsist.yaml"))
|
2022-01-08 02:11:08 +01:00
|
|
|
@test Input.getEnum(data["train"]["trainType"], trainType) == freight::trainType
|