Summary. Testing the equality of two survival distributions can be difficult in a prevalent cohort study when non-random sampling of subjects is involved. Owing to the biased sampling scheme, the independent censoring assumption is often violated. Although the issues about biased inference caused by length-biased sampling have been widely recognized in the statistical, epidemiological and economical literature, there is no satisfactory solution for efficient two-sample testing. We propose an asymptotic most efficient non-parametric test by properly adjusting for length-biased sampling. The test statistic is derived from a full likelihood function and can be generalized from the two-sample test to a k-sample test. The asymptotic properties of the test statistic under the null hypothesis are derived by using its asymptotic independent and identically distributed representation. We conduct extensive Monte Carlo simulations to evaluate the performance of the test statistics proposed and compare them with the conditional test and the standard log-rank test for various biased sampling schemes and right-censoring mechanisms. For length-biased data, empirical studies demonstrated that the test proposed is substantially more powerful than the existing methods. For general left-truncated data, the test proposed is robust, still maintains accurate control of the type I error rate and is also more powerful than the existing methods, if the truncation patterns and right censoring patterns are the same between the groups. We illustrate the methods by using two real data examples.