File tree Expand file tree Collapse file tree 1 file changed +53
-0
lines changed
src/Fabulous.Tests/APISketchTests Expand file tree Collapse file tree 1 file changed +53
-0
lines changed Original file line number Diff line number Diff line change @@ -687,6 +687,59 @@ module Issue104 =
687687
688688 instance.ProcessMessage( Toggle)
689689
690+ module Issue1044 =
691+ [<Test>]
692+ let ``Multiple Widgets + for loops in builder causes crash`` () =
693+ let view model =
694+ Stack() {
695+ Label( $" Foo" ) // It also crashes only with the multiple for loops
696+ Label( $" bar" ) // It also crashes only with the multiple for loops
697+
698+ for i = 0 to 10 do
699+ Label( $" T{i}" )
700+
701+ for i = 10 to 20 do
702+ Label( $" T{i}" )
703+
704+ for i = 20 to 30 do
705+ Label( $" T{i}" )
706+
707+ for i = 30 to 40 do
708+ Label( $" T{i}" )
709+ }
710+
711+ let init () = true
712+ let update ( _ : unit ) msg = not msg
713+ let program = StatefulWidget.mkSimpleView init update view
714+
715+ let instance = Run.Instance program
716+ instance.Start() |> ignore
717+
718+ [<Test>]
719+ let ``Multiple for loops in builder causes crash`` () =
720+ let view model =
721+ Stack() {
722+ for i = 0 to 10 do
723+ Label( $" T{i}" )
724+
725+ for i = 10 to 20 do
726+ Label( $" T{i}" )
727+
728+ for i = 20 to 30 do
729+ Label( $" T{i}" )
730+
731+ for i = 30 to 40 do
732+ Label( $" T{i}" )
733+ }
734+
735+ let init () = true
736+ let update ( _ : unit ) msg = not msg
737+ let program = StatefulWidget.mkSimpleView init update view
738+
739+ let instance = Run.Instance program
740+ instance.Start() |> ignore
741+
742+
690743module Attributes =
691744
692745 type MyEnum =
You can’t perform that action at this time.
0 commit comments