MCPcopy Index your code
hub / github.com/coder/coder / TestStopAfterBehaviorTools

Function TestStopAfterBehaviorTools

coderd/x/chatd/chatd_internal_test.go:650–684  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

648}
649
650func TestStopAfterBehaviorTools(t *testing.T) {
651 t.Parallel()
652
653 planMode := database.NullChatPlanMode{
654 ChatPlanMode: database.ChatPlanModePlan,
655 Valid: true,
656 }
657 exploreMode := database.NullChatMode{
658 ChatMode: database.ChatModeExplore,
659 Valid: true,
660 }
661
662 t.Run("DefaultModeReturnsNil", func(t *testing.T) {
663 t.Parallel()
664 require.Nil(t, stopAfterBehaviorTools(
665 database.NullChatPlanMode{},
666 database.NullChatMode{},
667 uuid.NullUUID{},
668 ))
669 })
670
671 t.Run("PlanModeDelegatesToPlanTools", func(t *testing.T) {
672 t.Parallel()
673 require.Equal(t, stopAfterPlanTools(planMode, uuid.NullUUID{}), stopAfterBehaviorTools(
674 planMode,
675 database.NullChatMode{},
676 uuid.NullUUID{},
677 ))
678 })
679
680 t.Run("ExploreModeReturnsNil", func(t *testing.T) {
681 t.Parallel()
682 require.Nil(t, stopAfterBehaviorTools(planMode, exploreMode, uuid.NullUUID{}))
683 })
684}
685
686// TestWaitForActiveChatStop and TestWaitForActiveChatStop_WaitsForReplacementRun
687// were removed along with the process-local activeChats mechanism.

Callers

nothing calls this directly

Calls 4

stopAfterBehaviorToolsFunction · 0.85
stopAfterPlanToolsFunction · 0.85
RunMethod · 0.65
EqualMethod · 0.45

Tested by

no test coverage detected