1package e2e23import (4 "strings"5 "testing"6)78// Tracing stays on as the pointer moves, lists what's off screen, goes9// to one from a list, and Evaluate formula steps into a reference and10// back out.11func TestTraceAndEvaluate(t *testing.T) {12 t.Parallel()13 s := start(t, "")14 s.keys("<ctrl+g>", "C1", "<enter>")15 s.keys("2", "<enter>", "=C1*3", "<enter>", "=C2+C1", "<enter>")16 s.keys("<ctrl+g>", "C40", "<enter>", "=C3", "<enter>")17 s.keys("<ctrl+g>", "C2", "<enter>")18 s.waitForBar("C2", "=C1*3")1920 s.keys("<alt+;>")21 s.waitFor("C2 reads C1↑; read by C3")22 s.keys("<down>")23 s.waitFor("C3 reads C2, C1↑; read by C40↓")2425 // Go to an off-screen dependent from the list.26 s.keys("<alt+'>")27 s.waitFor("Precedents and dependents of C3")28 s.keys("C40", "<enter>")29 s.waitForName("C40")30 s.waitFor("C40 reads C3")3132 // Evaluate C40: step into C3, compute it, step out.33 s.keys("<alt+=>")34 s.waitFor("Evaluate C40")35 s.waitFor("Next C3 = 8")36 s.keys("<right>")37 s.waitFor("Evaluate C40 › C3")38 s.keys("<enter>", "<enter>", "<enter>")39 s.waitFor("Value 8")40 s.keys("<left>")41 s.waitFor("Value 8")42 s.eventually("back at C40", func() bool { return !strings.Contains(s.screen(), "›") })43 s.keys("<esc>")44 s.eventually("closed", func() bool { return strings.Contains(s.line(0), "READY") })4546 s.keys("<alt+;>")47 s.eventually("tracing off", func() bool { return !strings.Contains(s.line(contextLine), "reads") })48}