736 |
|
|
737 |
|
|
738 |
|
|
739 |
|
## ------ ## |
740 |
|
## trace2 ## |
741 |
|
## ------ ## |
742 |
|
|
743 |
|
AT_SETUP([trace2]) |
744 |
|
|
745 |
|
AT_DATA([[trace2.m4]], |
746 |
|
[[traceon(`define') |
747 |
|
debugmode(`aeq') |
748 |
|
|
749 |
|
# copy the `define' builtin definition to another symbol |
750 |
|
define(`my_define', defn(`define')) |
751 |
|
|
752 |
|
# delete the original |
753 |
|
undefine(`define') |
754 |
|
|
755 |
|
# Does it work? |
756 |
|
my_define(`foo', `bar') |
757 |
|
|
758 |
|
# Use the new definition to redefine the original symbol |
759 |
|
my_define(`define', defn(`my_define')) |
760 |
|
|
761 |
|
# Torture the flag propogation |
762 |
|
undefine(`my_define') |
763 |
|
define(`my_define', defn(`define')) |
764 |
|
|
765 |
|
# There are now 2 symbols pointing to the same builtin function |
766 |
|
my_define(`foo', `bar') |
767 |
|
define(`foo', `bar') |
768 |
|
]]) |
769 |
|
|
770 |
|
AT_DATA([[expout]], |
771 |
|
[[ |
772 |
|
|
773 |
|
|
774 |
|
# copy the `define' builtin definition to another symbol |
775 |
|
|
776 |
|
|
777 |
|
# delete the original |
778 |
|
|
779 |
|
|
780 |
|
# Does it work? |
781 |
|
|
782 |
|
|
783 |
|
# Use the new definition to redefine the original symbol |
784 |
|
|
785 |
|
|
786 |
|
# Torture the flag propogation |
787 |
|
|
788 |
|
|
789 |
|
|
790 |
|
# There are now 2 symbols pointing to the same builtin function |
791 |
|
|
792 |
|
|
793 |
|
]]) |
794 |
|
|
795 |
|
AT_DATA([[experr]], |
796 |
|
[[m4trace: -1- define(`my_define', <define>) |
797 |
|
m4trace: -1- my_define(`foo', `bar') |
798 |
|
m4trace: -1- my_define(`define', <define>) |
799 |
|
m4trace: -1- define(`my_define', <define>) |
800 |
|
m4trace: -1- my_define(`foo', `bar') |
801 |
|
m4trace: -1- define(`foo', `bar') |
802 |
|
]]) |
803 |
|
|
804 |
|
AT_CHECK_M4([trace2.m4], 0, expout, experr) |
805 |
|
|
806 |
|
AT_CLEANUP |
807 |
|
|
808 |
|
|
809 |
|
|
810 |
|
## ------ ## |
811 |
|
## trace3 ## |
812 |
|
## ------ ## |
813 |
|
|
814 |
|
AT_SETUP([trace3]) |
815 |
|
|
816 |
|
AT_DATA([[trace3.m4]], |
817 |
|
[[# copy the `define' builtin definition to another symbol |
818 |
|
define(`my_define', defn(`define')) |
819 |
|
|
820 |
|
# delete the original |
821 |
|
undefine(`define') |
822 |
|
|
823 |
|
# Does it work? |
824 |
|
my_define(`foo', `bar') |
825 |
|
|
826 |
|
# Use the new definition to redefine the original symbol |
827 |
|
my_define(`define', defn(`my_define')) |
828 |
|
|
829 |
|
# Torture the flag propogation |
830 |
|
undefine(`my_define') |
831 |
|
define(`my_define', defn(`define')) |
832 |
|
|
833 |
|
# There are now 2 symbols pointing to the same builtin function |
834 |
|
my_define(`foo', `bar') |
835 |
|
define(`foo', `bar') |
836 |
|
]]) |
837 |
|
|
838 |
|
AT_DATA([[expout]], |
839 |
|
[[# copy the `define' builtin definition to another symbol |
840 |
|
|
841 |
|
|
842 |
|
# delete the original |
843 |
|
|
844 |
|
|
845 |
|
# Does it work? |
846 |
|
|
847 |
|
|
848 |
|
# Use the new definition to redefine the original symbol |
849 |
|
|
850 |
|
|
851 |
|
# Torture the flag propogation |
852 |
|
|
853 |
|
|
854 |
|
|
855 |
|
# There are now 2 symbols pointing to the same builtin function |
856 |
|
|
857 |
|
|
858 |
|
]]) |
859 |
|
|
860 |
|
AT_DATA([[experr]], |
861 |
|
[[m4trace: -1- define(`my_define', <define>) |
862 |
|
m4trace: -1- my_define(`foo', `bar') |
863 |
|
m4trace: -1- my_define(`define', <define>) |
864 |
|
m4trace: -1- define(`my_define', <define>) |
865 |
|
m4trace: -1- my_define(`foo', `bar') |
866 |
|
m4trace: -1- define(`foo', `bar') |
867 |
|
]]) |
868 |
|
|
869 |
|
AT_CHECK_M4([-t define -daeq trace3.m4], 0, expout, experr) |
870 |
|
|
871 |
|
AT_CLEANUP |
872 |
|
|
873 |
|
|
874 |
|
|
875 |
## -------- ## |
## -------- ## |
876 |
## translit ## |
## translit ## |
877 |
## -------- ## |
## -------- ## |