confirmatory testing, like a GC/MS or LC/MS/MS can tell them apart because they're different molecules, but the extraction processes for delta 9 THC can/will pick up all the similar molecules (delta 8, COOH, CBD, CBN, whatever).
that's necessary and good because they're not all psychoactive (the COOH in particular), so they've got to be separated out for forensic purposes.
it works as a sort of linearish equation, where you add up all the compounds at different ratios, like 1.0THC + 0.5COOH + 0.05CBD + 0.05CBN + ... and if that adds up to "enough" then the test will trigger the testing lab to consider the screen positive.
at that point hopefully it goes over to confirmatory testing, where the LC/MS/MS separates all the various compounds apart, and lets the lab know that you had CBD in your system, but not THC.