You are correct that a normal approximation would not be reliable for the specific outcome you mention.
Something like this may have been implemented in the
binom.test
procedure in R. [If a hypothetical
value is not entered, then $p_0 = 0.5$ is assumed.]
First, get the CI corresponding to 4 successes in 5 trials:
binom.test(4, 5, alt="g")
Exact binomial test
data: 4 and 5
number of successes = 4, number of trials = 5,
p-value = 0.1875
alternative hypothesis:
true probability of success is greater than 0.5
95 percent confidence interval:
0.3425917 1.0000000
sample estimates:
probability of success
0.8
Then verify that using the bound of the CI to specify the null hypothesis, puts you at the edge of the non-rejection region.
binom.test(4, 5, p=.3426, alt="g")
Exact binomial test
data: 4 and 5
number of successes = 4, number of trials = 5,
p-value = 0.05
alternative hypothesis:
true probability of success is greater than
0.3426
95 percent confidence interval:
0.3425917 1.0000000
sample estimates:
probability of success
0.8
Because of the discreteness of the binomial distribution and the particulars of the style
of CI implemented, you need to be careful
about definitions. Please read the documentation
of binom.test
to see if it really does what
you have in mind. Especially:
Details
Confidence intervals are obtained by a
procedure first given in Clopper and Pearson
(1934). This guarantees that the confidence
level is at least 'conf.level', but in general
does not give the shortest-length confidence
intervals.
Also, the Wikipedia page on CIs for binomial proportions may be useful--especially, the section on Clopper-Pearson CIs.