Here's how the test works:
1. Heating a sample with sodium metal: When a sample containing nitrogen is heated with sodium metal, the nitrogen reacts with the sodium to form sodium nitride (Na₃N).
2. Adding water: Water is then added to the reaction mixture. This causes the sodium nitride to react with water, producing ammonia gas (NH₃).
3. Testing for ammonia: The ammonia gas can be detected by its characteristic pungent odor or by using a litmus paper, which will turn blue in the presence of ammonia.
Therefore, although the test is based on the formation of ammonia, the gas that is ultimately evolved and indicates the presence of nitrogen is nitrogen gas (N₂).