All checks were successful
		
		
	
	ci / build (push) Successful in 3m43s
				
			Added the `First` field on the result set proxy Upgraded UCL to 0.1.0 Co-authored-by: Leon Mika <lmika@lmika.com> Reviewed-on: #2 Co-authored-by: Leon Mika <lmika@lmika.org> Co-committed-by: Leon Mika <lmika@lmika.org>
		
			
				
	
	
		
			36 lines
		
	
	
		
			854 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			36 lines
		
	
	
		
			854 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| package cmdpacks_test
 | |
| 
 | |
| import (
 | |
| 	"testing"
 | |
| 
 | |
| 	"github.com/stretchr/testify/assert"
 | |
| )
 | |
| 
 | |
| func TestModPB_Copy(t *testing.T) {
 | |
| 	t.Run("copy 1", func(t *testing.T) {
 | |
| 		svc := newService(t)
 | |
| 
 | |
| 		_, err := svc.CommandController.ExecuteAndWait(t.Context(), `
 | |
| 			items = @resultset.Items
 | |
| 			skItems = $items | map { |i| $i.sk } | lists:uniq
 | |
| 			pb:copy ($skItems | strs:join "\n")
 | |
| 		`)
 | |
| 		assert.NoError(t, err)
 | |
| 
 | |
| 		assert.Equal(t, "111\n222\n131", svc.pasteboard.content)
 | |
| 	})
 | |
| 
 | |
| 	t.Run("copy 2", func(t *testing.T) {
 | |
| 		svc := newService(t)
 | |
| 
 | |
| 		_, err := svc.CommandController.ExecuteAndWait(t.Context(), `
 | |
| 			items = @resultset.Items
 | |
| 			skItems = $items | map { |i| $i.alpha } | filter !nil | lists:uniq
 | |
| 			pb:copy ($skItems | strs:join "\n")
 | |
| 		`)
 | |
| 		assert.NoError(t, err)
 | |
| 
 | |
| 		assert.Equal(t, "This is some value\nThis is another some value", svc.pasteboard.content)
 | |
| 	})
 | |
| }
 |