2
0
Fork 0
mirror of https://github.com/bazel-contrib/rules_foreign_cc synced 2024-11-30 16:42:07 +00:00
rules_foreign_cc/test/utils_test.bzl
UebelAndre 898bed4efb
Enable Buildifier in CI (#458)
* Added Buildifier check to CI

* Addressed Buildifier lint defects
2021-01-25 22:01:43 +00:00

25 lines
700 B
Python

""" Unit tests for some utility functions """
load("@bazel_skylib//lib:unittest.bzl", "asserts", "unittest")
load("//tools/build_defs:framework.bzl", "uniq_list_keep_order")
def _uniq_list_keep_order_test(ctx):
env = unittest.begin(ctx)
list = [1, 2, 3, 1, 4, 1, 2, 3, 5, 1, 2, 4, 7, 5]
filtered = uniq_list_keep_order(list)
asserts.equals(env, [1, 2, 3, 4, 5, 7], filtered)
filtered_empty = uniq_list_keep_order([])
asserts.equals(env, [], filtered_empty)
return unittest.end(env)
uniq_list_keep_order_test = unittest.make(_uniq_list_keep_order_test)
def utils_test_suite():
unittest.suite(
"utils_test_suite",
uniq_list_keep_order_test,
)