MCPcopy Create free account
hub / github.com/diffplug/goomph / doTest

Method doTest

src/test/java/com/diffplug/gradle/LazyableTest.java:26–41  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

24
25public class LazyableTest {
26 @Test
27 public void doTest() {
28 Lazyable<List<String>> lazyable = Lazyable.ofList();
29 assertValue(lazyable);
30
31 lazyable.getRoot().add("a");
32 assertValue(lazyable, "a");
33 lazyable.addLazyAction(list -> {
34 list.add("1");
35 list.add("2");
36 });
37 assertValue(lazyable, "a", "1", "2");
38
39 lazyable.getRoot().add("b");
40 assertValue(lazyable, "a", "b", "1", "2");
41 }
42
43 private void assertValue(Lazyable<List<String>> lazyable, String... result) {
44 String actual = lazyable.getResult().stream().collect(Collectors.joining("\n"));

Callers

nothing calls this directly

Calls 5

ofListMethod · 0.95
assertValueMethod · 0.95
getRootMethod · 0.80
addLazyActionMethod · 0.80
addMethod · 0.45

Tested by

no test coverage detected