Is it illegal for a teacher to give student test on something they have not learned?
It's not necessarily *illegal* for a teacher to give a test on material not yet covered in class, but it's highly inappropriate and ineffective pedagogy. It would be considered unprofessional and a poor teaching practice. Parents and students could certainly complain to the school administration, and depending on the context (e.g., systemic pattern of poor teaching, intentional sabotage), there could be grounds for disciplinary action against the teacher. However, there isn't a specific law prohibiting this action in itself.