小编Nuk*_*Pan的帖子

是否可以手动更新行为的值?(函数式反应式编程,三便士)

我真希望我没有走进死胡同。我有一个行为,它给出当前选择的颜色和当前鼠标坐标,然后在单击鼠标时执行任务。该任务涉及查看列表,然后更新该列表中的值,以便稍后检索。我可以“存储”所选颜色这一事实让我希望可以以类似的方式存储列表。我正处于死胡同,不知道如何解决这个问题。非常感谢一些帮助。

\n
-- There is a Blue button and a Red button on our UI. Whichever\n-- button was clicked last is our current color selection.\ncolorRedSelected = const ColorRed <$ UI.click redButton\ncolorBlueSelected = const ColorBlue <$ UI.click blueButton\n\n-- we combine both the above Events to create a new one that tells us the current selected color\ncolorSelected = unionWith const colorRedSelected colorBlueSelected\n\n-- accumulate values for our Behaviour, starting with ColorRed selected by default\ncolorMode \xc2\xa0 \xc2\xa0 \xc2\xa0 <- accumB ColorRed modeEvent\n\n-- create a …
Run Code Online (Sandbox Code Playgroud)

haskell threepenny-gui

6
推荐指数
1
解决办法
153
查看次数

JUnit 测试 - ParameterizedTests - “没有将类型 java.lang.Integer 隐式转换为类型 [Ljava.lang.Integer;”

使用 JUnit5。这对我来说似乎表现不正确,我可能错过了一些东西。

    @ParameterizedTest
    @MethodSource
    void testFunc(Integer arr []) {
        for(Integer i : arr){
            System.out.print(i + " ");
        }
        System.out.println("\n");
    }

    static Stream<Arguments> testFunc() {
        return Stream.of(
                Arguments.of(new Integer [] {12, 42, 52, 1234, 12, 425, 4}),
                Arguments.of(new Integer [] {12, 42, 52, 1234, 12, 425}),
                Arguments.of(new Integer [] {12})
        );
    }
Run Code Online (Sandbox Code Playgroud)

产生错误:

org.junit.jupiter.api.extension.ParameterResolutionException: Error converting parameter at index 0: No implicit conversion to convert object of type java.lang.Integer to type [Ljava.lang.Integer;
Run Code Online (Sandbox Code Playgroud)

int我还尝试使用而不是上面的代码Integer,但这工作正常。

这可以正常工作,没有错误:

    public static void main(String …
Run Code Online (Sandbox Code Playgroud)

java testing junit

5
推荐指数
1
解决办法
8278
查看次数

标签 统计

haskell ×1

java ×1

junit ×1

testing ×1

threepenny-gui ×1