Skip to content

Commit

Permalink
add license to tests
Browse files Browse the repository at this point in the history
  • Loading branch information
damirka committed Jan 28, 2025
1 parent ee5a76e commit 1c23168
Show file tree
Hide file tree
Showing 39 changed files with 118 additions and 8 deletions.
3 changes: 3 additions & 0 deletions external-crates/move/tooling/tree-sitter/grammar.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) The Move Contributors
// SPDX-License-Identifier: Apache-2.0

const PRECEDENCE = {
assign: 1,
implies: 2, // ==>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
// Copyright (c) The Move Contributors
// SPDX-License-Identifier: Apache-2.0

module a::m {
public fun t2(condition: bool) {
if (condition) @0 else @0;
if (condition) @0x0 else @0;
if (condition) @ident else @0;
}
}

Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) The Move Contributors
// SPDX-License-Identifier: Apache-2.0

#[allow(unused_const, unused_variable)]

#[allow(unused_const, unused_variable)]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) The Move Contributors
// SPDX-License-Identifier: Apache-2.0

module foo::bar {
fun f(): u64 {
1 as u64;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) The Move Contributors
// SPDX-License-Identifier: Apache-2.0

module a::b {
fun f() {
a < *b && !c || (*&d == true);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) The Move Contributors
// SPDX-License-Identifier: Apache-2.0

module 0x1::a;
fun g() {
let x = withdraw_coin<CoinA, LpCoin>(state, lp_coin_amount, min_amounts[0], total_supply, ctx);
Expand All @@ -13,4 +16,3 @@ fun g() {
),
);
}

3 changes: 3 additions & 0 deletions external-crates/move/tooling/tree-sitter/tests/damir1.move
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) The Move Contributors
// SPDX-License-Identifier: Apache-2.0

module 0x0::o {
public fun test() {
to_vec_set<u64>(vector[1,5,3,4])
Expand Down
3 changes: 3 additions & 0 deletions external-crates/move/tooling/tree-sitter/tests/damir2.move
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) The Move Contributors
// SPDX-License-Identifier: Apache-2.0

module a::y {
fun a() {
a<u8>(a);
Expand Down
4 changes: 3 additions & 1 deletion external-crates/move/tooling/tree-sitter/tests/damir3.move
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/// Module: kek
// Copyright (c) The Move Contributors
// SPDX-License-Identifier: Apache-2.0

module kek::kek {
public struct Kek {
a: u8,
Expand Down
3 changes: 3 additions & 0 deletions external-crates/move/tooling/tree-sitter/tests/damir4.move
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) The Move Contributors
// SPDX-License-Identifier: Apache-2.0

module beep::boop {
fun index_expression() {
// incorrectly parsed as `(copy data)[i]`
Expand Down
3 changes: 3 additions & 0 deletions external-crates/move/tooling/tree-sitter/tests/damir5.move
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) The Move Contributors
// SPDX-License-Identifier: Apache-2.0

module beep::boop {
fun f(x: MyEnum): u8 {
match (x) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) The Move Contributors
// SPDX-License-Identifier: Apache-2.0

module 0x1::m {
fun f() {
let i = vector[i].to_string();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) The Move Contributors
// SPDX-License-Identifier: Apache-2.0

module 0x8675309::M;

public entry fun f0() {}
Expand All @@ -8,4 +11,3 @@ entry native fun f4();
entry native public fun f5();
native entry public fun f6();
native public entry fun f7();

Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) The Move Contributors
// SPDX-License-Identifier: Apache-2.0

module Completion::test;

public enum SomeEnum has drop {
Expand Down
3 changes: 3 additions & 0 deletions external-crates/move/tooling/tree-sitter/tests/labels1.move
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) The Move Contributors
// SPDX-License-Identifier: Apache-2.0

module 0x42::M {
fun foo() {}
fun bar(): u64 { 0 }
Expand Down
3 changes: 3 additions & 0 deletions external-crates/move/tooling/tree-sitter/tests/labels2.move
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) The Move Contributors
// SPDX-License-Identifier: Apache-2.0

module a::m {
// cases that need parens
fun t(cond: bool): u64 {
Expand Down
3 changes: 3 additions & 0 deletions external-crates/move/tooling/tree-sitter/tests/labels3.move
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) The Move Contributors
// SPDX-License-Identifier: Apache-2.0

module 0x42::M {

fun foo(_: &u64) {}
Expand Down
4 changes: 3 additions & 1 deletion external-crates/move/tooling/tree-sitter/tests/labels4.move
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) The Move Contributors
// SPDX-License-Identifier: Apache-2.0

module 0x42::M {
fun foo() {}
fun bar(): u64 { 0 }
Expand All @@ -24,4 +27,3 @@ module 0x42::M {
0
} }
}

Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) The Move Contributors
// SPDX-License-Identifier: Apache-2.0

module a::m;

public struct Point(u64, u64) has copy, drop, store;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) The Move Contributors
// SPDX-License-Identifier: Apache-2.0

module a::b;

fun lambda_tys_complex() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) The Move Contributors
// SPDX-License-Identifier: Apache-2.0

module 0x42::test {
struct Positional()
struct Positional2() has copy;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) The Move Contributors
// SPDX-License-Identifier: Apache-2.0

module 0x42::m {
fun test_04<T: drop>(x: Maybe<T>, other: Maybe<T>): Maybe<T> {
match (x) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) The Move Contributors
// SPDX-License-Identifier: Apache-2.0

module 0x42::m {

public struct NBase has copy, drop { t: u64 }
Expand Down Expand Up @@ -97,4 +100,3 @@ module 0x42::m {
}

}

Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) The Move Contributors
// SPDX-License-Identifier: Apache-2.0

module x::a;

fun bar(x: u64): u64 {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) The Move Contributors
// SPDX-License-Identifier: Apache-2.0

module match::test_module;

fun run(x: u64): u64 {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) The Move Contributors
// SPDX-License-Identifier: Apache-2.0

module 0x42::m;
fun t0(): u64 {
let Bla<T>(x) = 0;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) The Move Contributors
// SPDX-License-Identifier: Apache-2.0

module 0x1::m;
use a::b;
use a::c;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) The Move Contributors
// SPDX-License-Identifier: Apache-2.0

module foo::bar {
use std::{
ascii::{Self, String},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) The Move Contributors
// SPDX-License-Identifier: Apache-2.0

module 0x1::m {
fun f() {
x[];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) The Move Contributors
// SPDX-License-Identifier: Apache-2.0

module a::m {
friend // why
a::n;
Expand Down
3 changes: 3 additions & 0 deletions external-crates/move/tooling/tree-sitter/tests/mut_space.move
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) The Move Contributors
// SPDX-License-Identifier: Apache-2.0

module a::m;
public struct S {
f: u64,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) The Move Contributors
// SPDX-License-Identifier: Apache-2.0

module 0x1::t {

fun f() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) The Move Contributors
// SPDX-License-Identifier: Apache-2.0

module s::foo {
public native struct Booper has drop, copy;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) The Move Contributors
// SPDX-License-Identifier: Apache-2.0

module foo::bar;
// Imports
use std::vector::foo;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) The Move Contributors
// SPDX-License-Identifier: Apache-2.0

module 0x42::m {
public enum X has drop {
A { x: u64 },
Expand Down Expand Up @@ -49,4 +52,3 @@ module 0x42::m {
}
}
}

Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) The Move Contributors
// SPDX-License-Identifier: Apache-2.0

module a::x;

// mind the gap
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) The Move Contributors
// SPDX-License-Identifier: Apache-2.0

module a::aborts;

fun test_unable_to_destroy_non_zero() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) The Move Contributors
// SPDX-License-Identifier: Apache-2.0

module sui::foo {
public struct Bar { x: u64 }

Expand All @@ -7,7 +10,7 @@ module sui::foo {

fun h(x: Bar): u64 { x.x }

fun j(x: Bar): u64 {
fun j(x: Bar): u64 {
let mut x = x.x();
x.foo!()
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) The Move Contributors
// SPDX-License-Identifier: Apache-2.0

module Completion::test {
public enum SomeEnum has drop {
SomeVariant,
Expand Down

0 comments on commit 1c23168

Please sign in to comment.