It's an interesting thing because it must be awfully rare, to say the least. This is for the whole of first-class cricket, by the way, not just Test cricket.
1 Answer
This is impossible. Suppose the following happens:
- Team A score 100 all out
- Team B score 200 all out
- Team A score 100 all out
Team B will need to score 1 run in their second innings to win. If they are all dismissed for 0 runs (of course very unlikely), then the match is a tie. So they need to go out and bat to get that 1 run, at which point they will have won by 10 (or maybe 9, or 8...) wickets.
Had team A scored only 99 in the second innings, then Team B would have won by an innings and 1 run, and had they scored 101, Team B would have to score 2 to win. There is now way to "win by exactly an innings".
The case of runs being tied after the third innings has happened in five test matches, most recently between West Indies and India in 1983. None of the teams batting last had any difficulty in getting the required run to win the match.