# Verify that trim with --force works

# First time should simply succeed
exec cue trim -o test.cue file.cue
cmp test.cue file.cue

# Second time will fail without --force
! exec cue trim -o test.cue file.cue
stderr 'error writing "test.cue": file already exists'

# Second time with --force should succeed
exec cue trim --force -o test.cue file.cue
cmp test.cue file.cue

-- file.cue --
package hello

#who:    "World"
message: "Hello \(#who)!"
