예제 #1
0
        public void DefaultAnchorNameInPuse_CreateDefaultAnchor_UsesDifferentName()
        {
            SetFullModel(0xFF);
            ViewPort.Edit("@20 ^misc.temp._000100 @00!00(8) ^table[ptr<>]2 <100> ");

            ViewPort.Goto.Execute("100");
            ViewPort.SelectionEnd = new(3, 0);
            ViewPort.Cut(FileSystem);

            Assert.Equal(0x20, Model.GetAddressFromAnchor(new(), -1, "misc.temp._000100"));        // old anchor is still there
            Assert.Equal("^misc.temp._000100_1 FF FF FF FF", FileSystem.CopyText.value);           // copy includes new anchor
            Assert.Equal(new[] { 0x00 }, Model.GetUnmappedSourcesToAnchor("misc.temp._000100_1")); // address 0 should point to the new anchor
        }
예제 #2
0
        public void NamelessAnchor_Cut_PointerGetsName()
        {
            var fs = new StubFileSystem();

            ViewPort.Edit("<100> @100 @!put(FF) ^\"\" text");

            ViewPort.ExpandSelection(0, 0);
            ViewPort.Cut(fs);

            var pointer = Model.ExportMetadata(Singletons.MetadataInfo).UnmappedPointers.Single();

            Assert.Equal(0, pointer.Address);
            Assert.Contains("misc", pointer.Name);
        }