Skip to content

Commit

Permalink
Complex number with imaginary part cannot be converted to Float
Browse files Browse the repository at this point in the history
  • Loading branch information
JaroslavTulach committed Nov 11, 2024
1 parent c3852c7 commit 4387ccf
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test/Base_Tests/src/Main.enso
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import project.Semantic.Import_Loop.Spec as Import_Loop_Spec
import project.Semantic.Meta_Spec
import project.Semantic.Instrumentor_Spec
import project.Semantic.Meta_Location_Spec
import project.Semantic.Multi_Value_Spec
import project.Semantic.Names_Spec
import project.Semantic.Equals_Spec
import project.Semantic.Runtime_Spec
Expand Down Expand Up @@ -132,6 +133,7 @@ main filter=Nothing =
Meta_Spec.add_specs suite_builder
Instrumentor_Spec.add_specs suite_builder
Meta_Location_Spec.add_specs suite_builder
Multi_Value_Spec.add_specs suite_builder
Names_Spec.add_specs suite_builder
Numbers_Spec.add_specs suite_builder
Equals_Spec.add_specs suite_builder
Expand Down
16 changes: 16 additions & 0 deletions test/Base_Tests/src/Semantic/Multi_Value_Spec.enso
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from Standard.Base import all
from Standard.Test import all
import Standard.Base.Errors.Common.Type_Error

import project.Data.Complex.Complex

add_specs suite_builder =
suite_builder.group "Complex Multi Value" group_builder->
group_builder.specify "Cannot convert to flow if it has imaginary part" <|
c = Complex.new 1 5
Test.expect_panic Type_Error (c:Float)

main filter=Nothing =
suite = Test.build suite_builder->
add_specs suite_builder
suite.run_with_filter filter

0 comments on commit 4387ccf

Please sign in to comment.