THE recent pledge by China to refrain from selling weapons in unstable regions is being put to the test with a visit by President Yang Shangkun to Pakistan and Iran, diplomats and analysts say.The trip by Mr. Yang coincides with reports that China has sold Iran nuclear-weapons technology despite repeated Chinese assurances that it would not do so. Yang plans to leave Iran tomorrow for home. Military cooperation has likely been a central topic in Yang's talks with leaders from two of China's leading weapons customers, diplomats and foreign policy analysts say. Ensuing arms deals would indicate whether China will follow rules for weapons exports that it endorsed Oct. 18 with the four other permanent members of the United Nations Security Council. The five powers pledged to refrain from weapons sales that would intensify conflicts or regional tensions. Beijing denies reports of nuclear sales and is expected to sign the Nuclear Non-Proliferation Treaty soon. It is also considering an endorsement of the Missile Technology Control Regime, which sets limits on missiles capable of delivering nuclear warheads. But weapons sales to Southwest Asia could prove irresistible. Such sales to Pakistan and Iran would help China win favor with Muslim leaders influential among Islamic fundamentalists in China's western region of Xinjiang. "China's concern about unrest among its ethnic minorities is a main reason why it is keen to cultivate a friendly relationship with Islamic countries in Southwest Asia," says James Tang, professor of political science at the University of Hong Kong. Also, weapons sales to Islamabad and Tehran would bring China hard currency. China's military craves such revenue because for years it has lacked money to buy the items on its long "wish list," the diplomats and analysts say. Sophisticated hardware in any case is hard for China to obtain today. Moscow has shelved a sale of fighters to China since the failed right-wing coup; the West has banned arms sales to China since the crackdown on liberal activists in Beijing in June 1989. "Both [Pakistan and Iran] are willing to pay top-dollar for basic military hardware and so they're natural partners for China," a Western diplomat says on condition of anonymity. An offer of arms would help China acquire valuable weaponry from Iran: China hopes to obtain some of the Soviet-made MIG-29 and SU-25 fighters that Iraqi pilots flew to Iran during the Gulf war, diplomats say, quoting unconfirmed reports. Arms sales would also help Beijing geopolitically: Pakistan has aligned with China to counterbalance India, its longtime rival, and Iran helps China in its attempt to contain United States influence in the Middle East, the diplomats and analysts say. Pakistan is likely to be a ready buyer from China. Washington cut military and economic aid to Islamabad after it failed to give assurances that it was not developing nuclear weapons. China manufactures heavy tanks in a joint project with Pakistan and is widely believed to be involved in a similar project producing jet fighter trainers. Beijing has provided Islamabad with an atomic bomb design and helped it to enrich uranium, according to Western intelligence reports. China also has sold Iran a range of goods far broader than suggested by its well-publicized shipment of Silkworm missiles during the Iran-Iraq war, the diplomats say. Beijing is helping Tehran build a nuclear reactor and negotiating to supply it with M-11 missiles, according to unconfirmed press reports. And China has sold Iran devices that enrich uranium to the level required for a nuclear bomb, according to recent reports quoting unnamed sources in the Bush administration. Under the UN agreement, China is obliged to inform other members of the UN Security Council about the sale of major conventional weapons and certain missiles to Iran and other Middle Eastern countries. Nuclear weapons and ballistic missiles are not included in the agreement and sales to countries outside the Middle East such as Pakistan do not require such notification.