mirror of
				https://github.com/nsnail/spectre.console.git
				synced 2025-11-04 02:25:28 +08:00 
			
		
		
		
	This commit is contained in:
		
				
					committed by
					
						
						Patrik Svensson
					
				
			
			
				
	
			
			
			
						parent
						
							35ce60b596
						
					
				
				
					commit
					71a5d83067
				
			@@ -1,10 +1,10 @@
 | 
			
		||||
[?25l     
 | 
			
		||||
[38;5;11m*[0m foo
 | 
			
		||||
     
 | 
			
		||||
[2A     
 | 
			
		||||
[2K[1A[2K[1A     
 | 
			
		||||
[38;5;11m-[0m bar
 | 
			
		||||
     
 | 
			
		||||
[2A     
 | 
			
		||||
[2K[1A[2K[1A     
 | 
			
		||||
[38;5;11m*[0m baz
 | 
			
		||||
     
 | 
			
		||||
[2K[1A[2K[1A[2K[?25h
 | 
			
		||||
@@ -0,0 +1,12 @@
 | 
			
		||||
[?25l                                                    
 | 
			
		||||
[38;5;11m⣷[0m long text that should not interfere writeline text
 | 
			
		||||
                                                    
 | 
			
		||||
[2K[1A[2K[1A[38;5;15mxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx[0m
 | 
			
		||||
[38;5;15mxxxxxxxxxx[0m
 | 
			
		||||
                                                    
 | 
			
		||||
[38;5;11m⣷[0m long text that should not interfere writeline text
 | 
			
		||||
                                                    
 | 
			
		||||
[2K[1A[2K[1A                                                    
 | 
			
		||||
[38;5;11m⣷[0m long text that should not interfere writeline text
 | 
			
		||||
                                                    
 | 
			
		||||
[2K[1A[2K[1A[2K[?25h
 | 
			
		||||
@@ -49,4 +49,30 @@ public sealed class StatusTests
 | 
			
		||||
        // Then
 | 
			
		||||
        return Verifier.Verify(console.Output);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    [Fact]
 | 
			
		||||
    [Expectation("WriteLineOverflow")]
 | 
			
		||||
    public Task Should_Render_Correctly_When_WriteLine_Exceeds_Console_Width()
 | 
			
		||||
    {
 | 
			
		||||
        // Given
 | 
			
		||||
        var console = new TestConsole()
 | 
			
		||||
            .Colors(ColorSystem.TrueColor)
 | 
			
		||||
            .Width(100)
 | 
			
		||||
            .Interactive()
 | 
			
		||||
            .EmitAnsiSequences();
 | 
			
		||||
        var status = new Status(console)
 | 
			
		||||
        {
 | 
			
		||||
            AutoRefresh = false,
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        // When
 | 
			
		||||
        status.Start("long text that should not interfere writeline text", ctx =>
 | 
			
		||||
        {
 | 
			
		||||
            ctx.Refresh();
 | 
			
		||||
            console.WriteLine("x".Repeat(console.Profile.Width + 10), new Style(foreground: Color.White));
 | 
			
		||||
        });
 | 
			
		||||
 | 
			
		||||
        // Then
 | 
			
		||||
        return Verifier.Verify(console.Output);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user