github.com/keybase/client/go@v0.0.0-20240520164431-4f512a4c85a3/kbfs/test/complex_test.go (about)

     1  // Copyright 2017 Keybase Inc. All rights reserved.
     2  // Use of this source code is governed by a BSD
     3  // license that can be found in the LICENSE file.
     4  
     5  // These tests all do multiple operations while a user is unstaged.
     6  
     7  package test
     8  
     9  import (
    10  	"testing"
    11  )
    12  
    13  // Regression test for KBFS-2501
    14  func TestRenameAfterRenameThatWouldHaveBeenAnOverwrite(t *testing.T) {
    15  	test(t,
    16  		users("alice"),
    17  		as(alice,
    18  			mkfile("a/foo", "foo"),
    19  			mkfile("a/b/foo2", "foo2"),
    20  			mkfile("bar", "bar"),
    21  		),
    22  		as(alice,
    23  			rename("a", "b"),
    24  		),
    25  		as(alice,
    26  			rename("b/b", "a"),
    27  		),
    28  		as(alice,
    29  			write("b/foo", "foo after rename"),
    30  			write("bar", "bar after rename"),
    31  		),
    32  	)
    33  }