mirror of
https://github.com/Louis-CFM/coucou.git
synced 2026-12-07 07:32:35 +09:00
A pure FIFO of pending AskUserQuestions, like ApprovalQueue: one per session (a session asking again takes its older question's place and slot), up to 5. Each question gets a slot on its pill for the iPhone: the pill's own record for the first, "<pill>#2"… for the others, kept for the question's life. QuestionQueue.question(answering:onRecord:…) finds the question an iPhone answer is for, by fingerprint and record, so two sessions asking the very same question each get their own answer. Tests in scripts/test-question-queue.sh, in the Build workflow. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
9 lines
361 B
Bash
Executable File
9 lines
361 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
cd "$(dirname "$0")/.."
|
|
TEST_DIR="$(mktemp -d "${TMPDIR:-/tmp}/coucou-question-queue.XXXXXX")"
|
|
trap 'rm -rf "$TEST_DIR"' EXIT
|
|
swiftc NotchBuddy/Sources/App/QuestionQueue.swift NotchBuddy/Sources/App/AskQuestion.swift \
|
|
tests/QuestionQueueTests.swift -o "$TEST_DIR/question-queue-tests"
|
|
"$TEST_DIR/question-queue-tests"
|