But if the idiot light came on while the engine was running, there is more than likely a problem with the alternator, the cables or dirty battery posts.
Even a bad battery will test good while the alternator is doing its thing, and for a little while after the engine is shut down. But when you put a load tester on it, it will admit to being weak.
If the idiot light came on before the engine was started, the battery would be the suspect.
But you are right. If the alternator is OK, the truck will run forever until it is shut down.